-
Notifications
You must be signed in to change notification settings - Fork 911
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 Spring Boot service name guesser / ResourceProvider #6516
Add Spring Boot service name guesser / ResourceProvider #6516
Conversation
Nope, that's the spring boot autoconfigure starter code -- it's meant to be used instead of the javaagent, as a drop-in spring plugin. It's not included in the javaagent. |
...entelemetry/instrumentation/spring/autoconfigure/resources/SpringBootServiceNameGuesser.java
Outdated
Show resolved
Hide resolved
...lemetry/instrumentation/spring/autoconfigure/resources/SpringBootServiceNameGuesserTest.java
Outdated
Show resolved
Hide resolved
instrumentation/spring/spring-boot-resources/library/build.gradle.kts
Outdated
Show resolved
Hide resolved
...entelemetry/instrumentation/spring/autoconfigure/resources/SpringBootServiceNameGuesser.java
Outdated
Show resolved
Hide resolved
* Attempts to use ProcessHandle to get the full commandline of the current process. Will only | ||
* succeed on java 9+. |
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.
can we use https://docs.oracle.com/javase/8/docs/api/java/lang/management/RuntimeMXBean.html#getInputArguments-- instead, to get Java 8 support?
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.
nm, I see this is for getting program args, maybe rename method to attemptGetProgramArgsViaReflection
?
EDIT: oh, I see this is "full" commandline, so ignore my rename suggestion, maybe just a little more explicit javadoc to unconfuse those like me?
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.
Done 👍
...ain/java/io/opentelemetry/instrumentation/spring/resources/SpringBootServiceNameGuesser.java
Outdated
Show resolved
Hide resolved
...ain/java/io/opentelemetry/instrumentation/spring/resources/SpringBootServiceNameGuesser.java
Outdated
Show resolved
Hide resolved
...java/io/opentelemetry/instrumentation/spring/resources/SpringBootServiceNameGuesserTest.java
Outdated
Show resolved
Hide resolved
...ain/java/io/opentelemetry/instrumentation/spring/resources/SpringBootServiceNameGuesser.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
…ry#6516) * Add spring boot service name guesser. * add encoding * improve commandline handling * move guesser to own module * use readAllBytes which exists in java 8 * spotless * add note and link to spring docs * group for readability * repackage * Apply suggestions from code review Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com> * code review comments Co-authored-by: Mateusz Rzeszutek <mrzeszutek@splunk.com> Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
…ry#6516) * Add spring boot service name guesser. * add encoding * improve commandline handling * move guesser to own module * use readAllBytes which exists in java 8 * spotless * add note and link to spring docs * group for readability * repackage * Apply suggestions from code review Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com> * code review comments Co-authored-by: Mateusz Rzeszutek <mrzeszutek@splunk.com> Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
…ry#6516) * Add spring boot service name guesser. * add encoding * improve commandline handling * move guesser to own module * use readAllBytes which exists in java 8 * spotless * add note and link to spring docs * group for readability * repackage * Apply suggestions from code review Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com> * code review comments Co-authored-by: Mateusz Rzeszutek <mrzeszutek@splunk.com> Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
This is effectively the same addition that was over in open-telemetry/opentelemetry-java-contrib#427 and we agreed to move into the main instrumentation repo.
Is this the correct module/location?
This also relates to open-telemetry/opentelemetry-java#4718 because ideally we the guesser introduced in this changeset would not override other, potentially more meaningful
service.name
values that might have already been set by other components.