-
Notifications
You must be signed in to change notification settings - Fork 791
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 system metrics #1309
Add system metrics #1309
Conversation
Signed-off-by: Sergei Malafeev <sergei@malafeev.org>
Signed-off-by: Sergei Malafeev <sergei@malafeev.org>
Signed-off-by: Sergei Malafeev <sergei@malafeev.org>
Signed-off-by: Sergei Malafeev <sergei@malafeev.org>
Signed-off-by: Sergei Malafeev <sergei@malafeev.org>
@jkwatson do you want to review this? Metrics are your cup of tea, aren't they? |
Looks good to me! I'm just wondering where/how should we initialize it, as I'd like this to be part of the rest of the instrumentation. |
hey @malafeev! sorry for the delay, will review this by end of the week |
system-metrics/system-metrics.gradle
Outdated
|
||
dependencies { | ||
implementation deps.opentelemetryApi | ||
implementation "com.github.oshi:oshi-core:5.2.5" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3.4MB with transitive dependencies
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An alternative to this would be to add this but:
- Disable it by default AND
- Make oshi a compile dependency.
This way, if users want to leverage it, they'd need to explicitly enable this instrumentation part, AND provide the Oshi dependency themselves.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's a good idea to make oshi a compile dependency. How about we model this change exactly like any instrumentation, instrumentation/oshi/{library,javaagent}
for example. This code goes in library, giving user a manual way of instrumenting (calling the static method) similar to our other library instrumentations, and auto can call it automatically if oshi is found on the classpath (not sure if we have a pattern for this yet but figure it's possible right @trask?). We can start with just moving this into library and add javaagent later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In which case we should split out the JVM metrics into a separate instrumentation/jvm/library
too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code goes in library, giving user a manual way of instrumenting (calling the static method) similar to our other library instrumentations
Sounds good to me.
In which case we should split out the JVM metrics into a separate instrumentation/jvm/library too
Same.
@malafeev any opinion on this? ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with it. any other opinions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the idea of adding just library instrumentation in the first PR, and then work on how to integrate it into javaagent after that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved code to instrumentation/oshi/library
because both jvm and system metrics depend on oshi
Why this PR is blocked from merging? We do have one approval from @carlosalberto ... @trask do you still want to review this? |
Don't hold this up on my account. :) |
@iNikem it's blocked from merging because it hasn't been approved by someone in the CODEOWNERS file |
Signed-off-by: Sergei Malafeev <sergei@malafeev.org>
Signed-off-by: Sergei Malafeev <sergei@malafeev.org>
@trask could you review this PR again? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thx @malafeev! sorry for the delayed review
...umentation/oshi/library/src/main/java/io/opentelemetry/instrumentation/oshi/JavaMetrics.java
Outdated
Show resolved
Hide resolved
...umentation/oshi/library/src/main/java/io/opentelemetry/instrumentation/oshi/JavaMetrics.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Sergei Malafeev <sergei@malafeev.org>
Signed-off-by: Sergei Malafeev <sergei@malafeev.org>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thx @malafeev 👍
Signed-off-by: Sergei Malafeev <sergei@malafeev.org>
@malafeev can you merge master into your branch? we updated to otel api 0.10.0-SNAPSHOT, which breaks a couple of metric APIs, just in case it affects this PR |
Signed-off-by: Sergei Malafeev <sergei@malafeev.org>
Signed-off-by: Sergei Malafeev <sergei@malafeev.org>
@trask synced with master |
@malafeev looks like the branch needs a |
@trask master needs a |
oh no! I think I messed up with the merge enforcement switching over from CircleCI to GHA, which probably led to that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
It is based on open-telemetry/opentelemetry-java#1323
Spec: https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/metrics/semantic_conventions/system-metrics.md