Skip to content

chore: fixing issue with extension service files being overriden#2886

Open
arinn1204 wants to merge 1 commit into
open-telemetry:mainfrom
arinn1204:main
Open

chore: fixing issue with extension service files being overriden#2886
arinn1204 wants to merge 1 commit into
open-telemetry:mainfrom
arinn1204:main

Conversation

@arinn1204
Copy link
Copy Markdown

@arinn1204 arinn1204 commented May 29, 2026

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

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"}

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

Copilot AI review requested due to automatic review settings May 29, 2026 23:58
@arinn1204 arinn1204 requested a review from a team as a code owner May 29, 2026 23:58
@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla Bot commented May 29, 2026

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: arinn1204 / name: aaron (29bcd14)

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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/services entries 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"}
```
@arinn1204
Copy link
Copy Markdown
Author

will reopen once i figure out the CLA stuff

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants