Closed Thul95 closed 2 months ago
You still need to add the javaagent or use the wrapper.
Try adding the following environment variable.
AWS_LAMBDA_EXEC_WRAPPER=/opt/otel-handler
@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.
@tylerbenson I think this is not a bug, but misuse. Should we close this one?
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