Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add metrics for the total number of application threads started in the JVM #3562

Merged
merged 6 commits into from
Feb 17, 2023

Conversation

lenin-jaganathan
Copy link
Contributor

@lenin-jaganathan lenin-jaganathan commented Dec 9, 2022

  • generate a metric for total Threads started since the JVM start time. This is extremely useful to understand how an application is doing on thread creation and also understand the creation patterns. The existing metrics give the current status of threads but nothing about whether the threads are created newly or are existing ones. This metric will aid in such scenarios by taking deltas.

Copy link
Member

@jonatan-ivanov jonatan-ivanov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add tests for the changes in JvmGcMetrics but as I said I might move those to a separate PR.

@jonatan-ivanov
Copy link
Member

Could you please rebase this on main, that should solve the build failure I hope.

@jonatan-ivanov jonatan-ivanov changed the title Add additional JVM metrics Add metrics for the total number of threads started in the JVM Feb 16, 2023
@jonatan-ivanov
Copy link
Member

I was thinking of Loom and the usefulness of this for virtual thread. Also if it is possible to distinguish between virtual and non-virtual threads.

@jonatan-ivanov jonatan-ivanov changed the title Add metrics for the total number of threads started in the JVM Add metrics for the total number of application threads started in the JVM Feb 16, 2023
- generate a metric for total Threads started since Jvm start time
- When observing multiple applications(which run on different java versions / use different gc's) having gc has a dimension helps in better understanding the gc metrics.
@jonatan-ivanov
Copy link
Member

The build is failing, could you please run ./gradlew format to fix it?

@lenin-jaganathan
Copy link
Contributor Author

Yes on it @jonatan-ivanov . Having some trouble locally with switching branches. Will update this

…nder/jvm/JvmThreadMetrics.java

Co-authored-by: Jonatan Ivanov <jonatan.ivanov@gmail.com>
@shakuzen shakuzen merged commit 1647147 into micrometer-metrics:main Feb 17, 2023
@shakuzen shakuzen added the module: micrometer-core An issue that is related to our core module label Feb 17, 2023
@lenin-jaganathan lenin-jaganathan deleted the jvm_metrics branch February 17, 2023 14:01
@lenin-jaganathan
Copy link
Contributor Author

@shakuzen By any chance will this metric be available in 1.10.x versions?

@jonatan-ivanov
Copy link
Member

@lenin-jaganathan Since this is a new feature, not really. 1.10.x is a maintenance branch, we only release patch versions which can contain dependency upgrades and bugfixes but it is rare that they contain new features. This should go out early next week (hopefully on Monday) with 1.11.0-M2 and it should go GA in mid May with 1.11.0.

@lenin-jaganathan
Copy link
Contributor Author

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A general enhancement module: micrometer-binders module: micrometer-core An issue that is related to our core module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants