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

otel.resource.attributes and OTEL_RESOURCE_ATTRIBUTES doesn't work #1416

Open
marquiswang opened this issue Aug 15, 2024 · 1 comment
Open

Comments

@marquiswang
Copy link

Component(s)

maven-extension

What happened?

Description

Setting the otel.resource.attributes doesn't work, contrary to documentation.

I tested a few versions - this was working in 1.27, and stopped working in 1.28 and does not work in latest.

Steps to Reproduce

Configure the opentelemetry-maven-extension (I'm exporting to Honeycomb, but I don't expect it to make a difference).

Run:

mvn clean -Dotel.resource.attributes="key1=val1,key2=val2" 

Expected Result

These attributes are exported to the otel collector.

Actual Result

These attributes are missing.

Component version

v1.28.0 - v.37.0

Log output

When building with 1.27 and -X, I get

[DEBUG] ContextStorageClass=io.opentelemetry.context.ThreadLocalContextStorage, identity=375273627 classloader=ClassRealm[coreExtensi
on>io.opentelemetry.contrib:opentelemetry-maven-extension:1.27.0-alpha, parent: ClassRealm[plexus.core, parent: null]] codeLocation=f
ile:/Users/mwang/.m2/repository/io/opentelemetry/contrib/opentelemetry-maven-extension/1.27.0-alpha/opentelemetry-maven-extension-1.2
7.0-alpha.jar
[DEBUG] OpenTelemetry: Initialize OpenTelemetrySdkService v1.27.0-alpha...
[DEBUG] OpenTelemetry: OpenTelemetry SDK initialized with  Configuration: otel.traces.exporter=otlp, otel.exporter.otlp.endpoint=https://api.honeycomb.io, otel.resource.attributes=key1=val1,key2=val2, Resource: {key1="val1", key2="val2", service.name="maven", service.version="3.9.8", telemetry.sdk.language="java", telemetry.sdk.name="opentelemetry", telemetry.sdk.version="1.27.0"}
[DEBUG] OpenTelemetry: OpenTelemetry extension registered as execution listener. InitialExecutionListener: org.apache.maven.eventspy.internal.EventSpyExecutionListener@7e7fe6d
[DEBUG] OpenTelemetry: afterSessionStart

When building with 1.28, I just see:

[DEBUG] OpenTelemetry: Initialize OpenTelemetrySdkService v1.28.0-alpha...
[DEBUG] OpenTelemetry: OpenTelemetry SDK initialized
[DEBUG] OpenTelemetry: OpenTelemetry extension registered as execution listener. InitialExecutionListener: org.apache.maven.eventspy.internal.EventSpyExecutionListener@4c447c09
[DEBUG] OpenTelemetry: afterSessionStart

Additional context

No response

@cyrille-leclerc
Copy link
Member

cyrille-leclerc added a commit to cyrille-leclerc/opentelemetry-java-contrib that referenced this issue Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants