You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When in AWS lambda using the java agent layer, both for layer v1 and v2. You can't access the Opentelemetry instance defined by the layer. GlobalOpenTelemetry.get() returns a DefaultOpenTelemetry{propagators=DefaultContextPropagators{textMapPropagator=NoopTextMapPropagator}}.
However my code is correctly instrumented and traces are being forwarded to my collector also context is correctly propagated/injected on to produced records on my Kafka topic.
Steps to reproduce
Deploy AWS java lambda with layer arn:aws:lambda:${aws:region}:184161586896:layer:opentelemetry-javaagent-0_2_0:1. Add implementation("io.opentelemetry:opentelemetry-api:1.32.0") to the classpath and try to get the global opentelemetry instance using GlobalOpenTelemetry.get()
What did you expect to see? GlobalOpenTelemetry.get() returns the OpenTelemetry instance used by layer.
What did you see instead? GlobalOpenTelemetry.get() returns OpenTelemetry.noop()
What version of collector/language SDK version did you use?
Thul95
changed the title
GlobalOpenTelemetry.get() return Noop implementation when using java lambda layer
GlobalOpenTelemetry.get() returns Noop implementation when using java lambda layer
Dec 15, 2023
@Thul95 Yes, @tylerbenson is correct. You are missing setting AWS_LAMBDA_EXEC_WRAPPER environment variable. Otherwise, Java agent is not activated and in this case it is expected that there is no trace context started.
Describe the bug
When in AWS lambda using the java agent layer, both for layer v1 and v2. You can't access the Opentelemetry instance defined by the layer.
GlobalOpenTelemetry.get()
returns aDefaultOpenTelemetry{propagators=DefaultContextPropagators{textMapPropagator=NoopTextMapPropagator}}
.However my code is correctly instrumented and traces are being forwarded to my collector also context is correctly propagated/injected on to produced records on my Kafka topic.
Steps to reproduce
Deploy AWS java lambda with layer
arn:aws:lambda:${aws:region}:184161586896:layer:opentelemetry-javaagent-0_2_0:1
. Addimplementation("io.opentelemetry:opentelemetry-api:1.32.0")
to the classpath and try to get the global opentelemetry instance usingGlobalOpenTelemetry.get()
What did you expect to see?
GlobalOpenTelemetry.get()
returns the OpenTelemetry instance used by layer.What did you see instead?
GlobalOpenTelemetry.get()
returnsOpenTelemetry.noop()
What version of collector/language SDK version did you use?
What language layer did you use?
Java 17
The text was updated successfully, but these errors were encountered: