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

More JFR streaming handlers #644

Closed

Conversation

roberttoyonaga
Copy link
Contributor

@roberttoyonaga roberttoyonaga commented Dec 14, 2022

Description:
These changes add more handlers in an effort to help the JFR streaming implementation meet the semantic conventions defined here.

With the addition of these new changes, the JFR streaming implementation will be as complete as possible with the data emitted by current JFR events. Continuing to make this JFR streaming implementation more complete would require changes to JFR itself in OpenJDK, such as adding new events or adding additional data to existing events.

Testing:

Tests were added in BufferMetricTest, GCDurationMetricTest, MemoryCommittedMetricTest, MemoryLimitMetricTest, MemoryInitMetricTest, and MemoryUsageMetricTest. Existing tests were also updated where needed.

Outstanding items:
A list of changes to OpenJDK JFR in order to help meet the semantic conventions should be compiled. The next step is to contribute the new events/instrumentation to the JDK, then to utilize those changes by updating the handlers in this repo.

@roberttoyonaga roberttoyonaga marked this pull request as ready for review December 14, 2022 21:36
@jack-berg
Copy link
Member

Thanks for the submission!

Can you submit separate PRs for Garbage collection, memory, buffer, and CPU? There's a lot to review in this and separating by domain will help keep review conversations focussed.

@roberttoyonaga
Copy link
Contributor Author

t separate PRs for Garbage collection, memory, buffer, and CPU? There's a lot to review in this and separating by domain will help keep review conversations focussed.

Yup! I can do that :)

trask pushed a commit that referenced this pull request Jan 3, 2023
**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.
trask pushed a commit that referenced this pull request Jan 3, 2023
**Description:**

This PR adds changes that implement the metric
`process.runtime.jvm.gc.duration`.

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.

**Testing:**

Tests were added but they don't have great coverage. In the future we
need to devise a reliable way to test each GC. Currently, I'm not sure
of a way to change GCs at runtime in order to test them all. I'm also
uncertain of how to reliably force young gen GC and old gen GC. As a
result, the test added in this PR basically just invokes "some" GC and
ensures that the resulting metric has data that is expected.

Co-authored-by: jack-berg <34418638+jack-berg@users.noreply.github.com>
trask pushed a commit that referenced this pull request Jan 14, 2023
**Description:**
This PR updates the implementation for the metrics
`process.runtime.jvm.memory.limit` ,
`process.runtime.jvm.memory.usage_after_last_gc` ,
`process.runtime.jvm.memory.committed`,
`process.runtime.jvm.memory.init`, `process.runtime.jvm.memory.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 is 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.

Some of the attribute key-value pairs outlined
[here](https://github.com/open-telemetry/opentelemetry-java-instrumentation/tree/main/instrumentation/runtime-metrics/library#garbage-collector-dependent-metrics)
are not present with the current implementation. This is because they
require additional JFR data, or new events. In the future, when JFR is
updated, these handlers should be revisited and updated to cover all the
missing attribute key-value pairs.
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