Skip to content

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

Merged
shakuzen merged 6 commits into
micrometer-metrics:mainfrom
lenin-jaganathan:jvm_metrics
Feb 17, 2023
Merged

shakuzen merged 6 commits into
micrometer-metrics:mainfrom
lenin-jaganathan:jvm_metrics

Conversation

@lenin-jaganathan

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

Copy link
Copy Markdown
Contributor
  • 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.

@lenin-jaganathan lenin-jaganathan changed the title Update JVM metrics Add additional JVM metrics Dec 12, 2022

@jonatan-ivanov jonatan-ivanov left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Member

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

@lenin-jaganathan

Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

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

@jonatan-ivanov

Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

Thanks.

@jonatan-ivanov jonatan-ivanov added instrumentation An issue that is related to instrumenting a component and removed module: micrometer-binders labels Sep 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement A general enhancement instrumentation An issue that is related to instrumenting a component 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