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 buffer handlers and implement buffer metrics #650

Merged
merged 5 commits into from
Jan 3, 2023

Conversation

roberttoyonaga
Copy link
Contributor

@roberttoyonaga roberttoyonaga commented Dec 15, 2022

Description:
Add handlers for buffer metrics process.runtime.jvm.buffer.limit, process.runtime.jvm.buffer.count, and process.runtime.jvm.buffer.usage.

This was a part of a larger PR here: #644.

jfr-streaming/src/main/java/io/opentelemetry/contrib/jfr/metrics/internal/Constants.java has been kept the same as it was in the larger PR because it's used in all of the smaller constituent PRs. This will hopefully also avoid some conflicts as the PRs are sequentially merged. As a result, there are some constants that are defined, but not used in this PR.

@roberttoyonaga roberttoyonaga changed the title buffer handlers Add buffer handlers and implement buffer metrics Dec 15, 2022
@roberttoyonaga roberttoyonaga marked this pull request as ready for review December 15, 2022 19:59
Copy link
Member

@jack-berg jack-berg left a comment

Choose a reason for hiding this comment

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

Just a few minor comments. Thanks!


@Override
public Optional<Duration> getPollingDuration() {
return Optional.of(Duration.ofSeconds(1));
Copy link
Member

Choose a reason for hiding this comment

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

What's the significance of the polling duration? Why 1s vs. 5s, 10s, etc?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The JFR streaming system flushes the in memory JFR buffers holding event data to the disk repo at 1s intervals, at which point they may be consumed by the handlers. So polling at 1s intervals should provide the most up to date data without adding unnecessary overhead.

@trask trask merged commit 777ba03 into open-telemetry:main Jan 3, 2023
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.

5 participants