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

Update aws lambda spec to remove X-Ray Env propagation #3166

Merged
merged 11 commits into from
Feb 10, 2023
Original file line number Diff line number Diff line change
Expand Up @@ -61,22 +61,22 @@ and the [cloud resource conventions][cloud]. The following AWS Lambda-specific a
[faasres]: ../../../resource/semantic_conventions/faas.md (FaaS resource conventions)
[cloud]: ../../../resource/semantic_conventions/cloud.md (Cloud resource conventions)

### Determining the parent of a span
### EventToCarrier

The parent of the span MUST be determined by considering both the environment and any headers or attributes
available from the event.
Each event type may represent propagation data in its own way. Instrumentation SHOULD support a user defined transform
function which takes the event as an argument and returns a carrier that can be passed into the configured propagators.
Instrumentation SHOULD provide default implementations for the standard event types.

If the `_X_AMZN_TRACE_ID` environment variable is set, instrumentations SHOULD first try to parse an
### AWS X-Ray Environment Span Link

If the `_X_AMZN_TRACE_ID` environment variable is set, instrumentation SHOULD try to parse an
carlosalberto marked this conversation as resolved.
Show resolved Hide resolved
OpenTelemetry `Context` out of it using the [AWS X-Ray Propagator](../../../context/api-propagators.md). If the
resulting `Context` is [valid](../../api.md#isvalid) and sampled, then this `Context` is the parent of the
function span. We check if it is valid because sometimes the `_X_AMZN_TRACE_ID` environment variable contains
an incomplete trace context which indicates X-Ray isn’t enabled. The environment variable will be set and the
resulting `Context` is [valid](../../api.md#isvalid) then a span link should be added to the lambda span with
tylerbenson marked this conversation as resolved.
Show resolved Hide resolved
an associated attribute of `source=x-ray-env` to indicate the source of the linked span.
Instrumentation needs to check if the context is valid because the `_X_AMZN_TRACE_ID` environment variable may
tylerbenson marked this conversation as resolved.
Show resolved Hide resolved
contain an incomplete trace context which indicates X-Ray isn’t enabled. The environment variable will be set and the
`Context` will be valid and sampled only if AWS X-Ray has been enabled for the Lambda function. A user can
disable AWS X-Ray for the function if X-Ray propagation is not desired.

Otherwise, when X-Ray propagation fails, the user's configured propagators SHOULD be applied to the HTTP
headers of the request to extract a `Context`. For example, API Gateway proxy requests can be configured to
send HTTP headers to a Lambda function using [a body mapping template](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-override-request-response-parameters.html).
disable AWS X-Ray for the function if the X-Ray span link is not desired.
tylerbenson marked this conversation as resolved.
Show resolved Hide resolved
tylerbenson marked this conversation as resolved.
Show resolved Hide resolved

## API Gateway

Expand Down