-
Notifications
You must be signed in to change notification settings - Fork 881
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
detect service.name based on build-info.properties #10515
detect service.name based on build-info.properties #10515
Conversation
2400cdb
to
545823f
Compare
545823f
to
bff1146
Compare
added to this PR |
...in/java/io/opentelemetry/instrumentation/spring/resources/SpringBootServiceNameDetector.java
Outdated
Show resolved
Hide resolved
3b4b952
to
40056cf
Compare
The
It could be used instead of the detector based on the JAR file name, and the version may ne deduced from Another option may be to use the manifest file. |
no, you have to trigger that explicitly
yes, that's why I'm proposing to downgrade the priority of the jar detector: #10523
If you want to do something manually, I'd suggest to use |
I am surprised. I have tested with the Spring Boot Maven plugin and the build info file is generated without any additional configuration. |
Agree for Maven |
My bad - the smoke test runs without this as well. |
6f57aee
to
06c22b6
Compare
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.
Could you please fix the merge conflict?
06c22b6
to
416a038
Compare
|
@jeanbisutti can you review? (I know we talked about it, but I don't remember if anything needs to be done) |
6e34bfa
to
ffb7cd3
Compare
I added an integration test now (smoke test), which is not a spring starter test. |
Now I got it - the smoke test image is referred to by a tag - so it's not using the image generated in the current build. |
The smoke tests based on a Docker image are used to test the Java agent, not the OpenTelemetry Spring starter. |
...main/java/io/opentelemetry/instrumentation/spring/resources/SpringBootBuildInfoDetector.java
Show resolved
Hide resolved
...main/java/io/opentelemetry/instrumentation/spring/resources/SpringBootBuildInfoDetector.java
Outdated
Show resolved
Hide resolved
@@ -1,2 +1 @@ | |||
build.artifact=something | |||
build.name=some-name |
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.
Cold you please explain the removal of this line?
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 is a test file that is supposed to not find the expected entry.
Before, it did not have build.version
- and now it also must not have build.name
.
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 would need to verify it works with GraalVM.
import java.util.Properties; | ||
import java.util.logging.Logger; | ||
|
||
public abstract class SpringBootBuildInfoDetector implements ConditionalResourceProvider { |
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'd rather avoid inheritance and do composition. But it's not a blocker for this case that keeps simple.
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.
yes, that's a good point - wdyt about using the mechanism from #10621 ?
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.
For my point of view it could be great, but only for new classes.
145660f
to
751c5bd
Compare
is outdated now - re-open if needed |
Add new resource provider
SpringBootBuildInfoServiceNameDetector
.