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 system metrics #1309

Merged
merged 20 commits into from
Oct 27, 2020
Merged

Add system metrics #1309

merged 20 commits into from
Oct 27, 2020

Conversation

Sergei Malafeev added 6 commits October 2, 2020 20:42
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>
@malafeev malafeev marked this pull request as ready for review October 7, 2020 14:32
@malafeev
Copy link
Contributor Author

malafeev commented Oct 7, 2020

cc @carlosalberto

Sergei Malafeev added 2 commits October 7, 2020 23:33
Signed-off-by: Sergei Malafeev <sergei@malafeev.org>
@iNikem
Copy link
Contributor

iNikem commented Oct 12, 2020

@jkwatson do you want to review this? Metrics are your cup of tea, aren't they?

@carlosalberto
Copy link
Contributor

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.

@carlosalberto carlosalberto self-requested a review October 13, 2020 13:26
@trask
Copy link
Member

trask commented Oct 14, 2020

hey @malafeev! sorry for the delay, will review this by end of the week


dependencies {
implementation deps.opentelemetryApi
implementation "com.github.oshi:oshi-core:5.2.5"
Copy link
Contributor Author

@malafeev malafeev Oct 19, 2020

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

Copy link
Contributor

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:

  1. Disable it by default AND
  2. 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.

Copy link
Contributor

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.

For reference, https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/master/instrumentation/grpc-1.5/library/grpc-1.5-library.gradle

Copy link
Contributor

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

Copy link
Contributor

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? ;)

Copy link
Contributor Author

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?

Copy link
Member

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

Copy link
Contributor Author

@malafeev malafeev Oct 21, 2020

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

@iNikem
Copy link
Contributor

iNikem commented Oct 20, 2020

Why this PR is blocked from merging? We do have one approval from @carlosalberto ... @trask do you still want to review this?

@jkwatson
Copy link
Contributor

@jkwatson do you want to review this? Metrics are your cup of tea, aren't they?

Don't hold this up on my account. :)

@trask
Copy link
Member

trask commented Oct 21, 2020

Why this PR is blocked from merging?

@iNikem it's blocked from merging because it hasn't been approved by someone in the CODEOWNERS file

Sergei Malafeev added 4 commits October 21, 2020 20:18
Signed-off-by: Sergei Malafeev <sergei@malafeev.org>
Signed-off-by: Sergei Malafeev <sergei@malafeev.org>
@malafeev
Copy link
Contributor Author

@trask could you review this PR again?

Copy link
Member

@trask trask left a 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

Sergei Malafeev added 2 commits October 27, 2020 10:39
Signed-off-by: Sergei Malafeev <sergei@malafeev.org>
Signed-off-by: Sergei Malafeev <sergei@malafeev.org>
Copy link
Member

@trask trask left a 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>
@trask
Copy link
Member

trask commented Oct 27, 2020

@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

Sergei Malafeev added 4 commits October 27, 2020 11:55
Signed-off-by: Sergei Malafeev <sergei@malafeev.org>
Signed-off-by: Sergei Malafeev <sergei@malafeev.org>
Signed-off-by: Sergei Malafeev <sergei@malafeev.org>
@malafeev
Copy link
Contributor Author

@trask synced with master

@trask
Copy link
Member

trask commented Oct 27, 2020

@malafeev looks like the branch needs a ./gradlew spotlessApply

@malafeev
Copy link
Contributor Author

@trask master needs a ./gradlew spotlessApply :)

@trask
Copy link
Member

trask commented Oct 27, 2020

oh no! I think I messed up with the merge enforcement switching over from CircleCI to GHA, which probably led to that

@trask trask mentioned this pull request Oct 27, 2020
Copy link
Contributor

@anuraaga anuraaga left a comment

Choose a reason for hiding this comment

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

Thanks!

@trask trask merged commit d2813c8 into open-telemetry:master Oct 27, 2020
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

6 participants