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 jvm cpu metrics #6107

Merged
merged 3 commits into from
Jun 3, 2022
Merged

Add jvm cpu metrics #6107

merged 3 commits into from
Jun 3, 2022

Conversation

jack-berg
Copy link
Member

Reflects the semantic conventions in #2292.

@jack-berg jack-berg requested a review from a team as a code owner May 27, 2022 20:17

meter
.gaugeBuilder("process.runtime.jvm.system.cpu.load_1m")
.setDescription("Average CPU load of the whole system for the last minute")
Copy link
Member Author

Choose a reason for hiding this comment

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

This definition from the semantic convention doesn't really match the the description from the OperatingSystemMXBean. It's a pretty odd calculation as it isn't bounded to the range [0,1], [0, 100] or even to [0, 100*N] where N is the number of processors.

This stack overflow post describes it as the "average is the number of waiting threads", and says the upper limit is equal to the number of threads you have.

Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't this the same as unix load average that is displayed for example by uptime?

Copy link
Contributor

@breedx-splk breedx-splk left a comment

Choose a reason for hiding this comment

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

The casting bit to work around multiple implementations is a drag. Bummer there isn't a common interface. Otherwise, looks like a nice straightforward impl. Thanks!

@trask trask merged commit cbf5bc3 into open-telemetry:main Jun 3, 2022
@laurit laurit mentioned this pull request Jun 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants