chore: fixing issue with extension service files being overriden#2886
Open
arinn1204 wants to merge 1 commit into
Open
chore: fixing issue with extension service files being overriden#2886arinn1204 wants to merge 1 commit into
arinn1204 wants to merge 1 commit into
Conversation
|
|
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Updates the Maven extension packaging to preserve Service Provider Interface (SPI) registrations when building the shaded/bundled JAR, preventing META-INF/services files from overwriting each other.
Changes:
- Enable merging of colliding
META-INF/servicesentries during JAR creation. - Configure duplicate handling to support service file merging.
The maven-extension service files were being overriden, which lead to EnvironmentResourceProvider
not being respected and forcing the span attributes to be whatever is
defaulted.
Snippets from a build job where i had this jar committed
old
```
16:30:38 [DEBUG] OpenTelemetry: OpenTelemetrySdkService initialized, resource:Resource{schemaUrl=null, attributes={service.name="maven", service.version="3.8.9", telemetry.distro.name="opentelemetry-maven-extension", telemetry.distro.version="1.57.0-alpha", telemetry.sdk.language="java", telemetry.sdk.name="opentelemetry", telemetry.sdk.version="1.62.0"}}
```
new
```
15:18:46 [DEBUG] OpenTelemetry: OpenTelemetry SDK initialized with Configuration: otel.traces.exporter=otlp, otel.exporter.otlp.endpoint=http://<otlp endpoint>, otel.resource.attributes=deployment.environment=prod,service.version=1.0.27-20260528151646,location=CI,build.release=false, otel.service.name=build, Resource: {build.release="false", deployment.environment="prod", location="CI", service.name="build", service.version="1.0.27-20260528151646", telemetry.sdk.language="java", telemetry.sdk.name="opentelemetry", telemetry.sdk.version="1.27.0"}
```
Author
|
will reopen once i figure out the CLA stuff |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
The maven-extension service files were being overridden, which lead to EnvironmentResourceProvider not being respected and forcing the span attributes to be whatever is defaulted. This lead to things like service.name and service.version always being hard coded to the maven version (see below)
Snippets from a build job where i had this jar committed
old
new
Existing Issue(s):
#2537
Testing:
I wired up the jar by overriding the maven extension path to see the debug logs showing the OTEL_RESOURCE_ATTRIBUTES was being respected by adding our custom tags