Skip to content

Add jvm cpu metrics#6107

Merged
trask merged 3 commits intoopen-telemetry:mainfrom
jack-berg:jvm-cpu-metrics
Jun 3, 2022
Merged

Add jvm cpu metrics#6107
trask merged 3 commits intoopen-telemetry:mainfrom
jack-berg:jvm-cpu-metrics

Conversation

@jack-berg
Copy link
Copy Markdown
Member

Reflects the semantic conventions in #2292.

@jack-berg jack-berg requested a review from a team 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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

4 participants