-
Notifications
You must be signed in to change notification settings - Fork 227
Description
Describe the bug
There are breaking changes that were inserted in this PR in the OpenTelemetry Java Instrumentation for aws-lambda.
To describe what will happen once the lambda layer starts using Java Instrumentation >= 1.25.0 I created a test case with the following scenario:
Client -> API Gateway Rest -> lambda a -> API Gateway Rest -> Lambda b.
API Gateway and Lambda have active tracing enabled.
The following image presents the behaviour observed when ingesting the traces into AWS X-Ray with lambdas with a lambda layer wrapper using Java Instrument 1.24.0.
The nodes containing cogs (lambda-java-a and lambda-java-b) are generated from spans created using the lambda function instrumented with OpenTelemetry.
The following image presents the behaviour observed when ingesting the traces into AWS X-Ray with lambdas with a lambda layer wrapper using Java Instrument 1.26.0.

As we can see, there will be a disconnection between the AWS components and the lambda code instrumented using OpenTelemetry. That was the expected behaviour of the PR: it will only consider the headers and the spans present in the _X_AMZN_TRACE_ID environment variable will be added to the span as span links.
Having said that, I would like to challenge how this change was put in place. There is no mechanism to avoid existing users to face a breaking change.
Moreover, I'm not even sure if the current implementation makes sense, because the linked spans will not be accessible in backends other than X-Ray: the traces emitted from the AWS components are sent directly to X-Ray and therefore there is no point in always adding span links for spans that will no be accessible in case the backend is not X-Ray.
Steps to reproduce
Use a lambda
What did you expect to see?
I expected that there is a way for users to avoid facing breaking change.
What version of collector/language SDK version did you use?
OpenTelemetry Java Instrumentation v1.26.0
What language layer did you use?
Java
Additional context
We are creating this issue to raise awareness of incoming breaking changes. I understand that this behaviour is defined in the spec, however I wanted to register that this is still a breaking change that will cause pain for users.
Related PRs in other languages:
open-telemetry/opentelemetry-js-contrib#1411
open-telemetry/opentelemetry-python-contrib#1657
