-
Notifications
You must be signed in to change notification settings - Fork 849
feat(aws-lambda): Add trace headers to aws_lambda instrumentation #4075
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
base: main
Are you sure you want to change the base?
feat(aws-lambda): Add trace headers to aws_lambda instrumentation #4075
Conversation
|
What issue is this trying to solve exactly? Even if you are using API Gateway, Lambda URLs or ALBs, headers should still be propagated normally from client to server. If this change is more about adding the ability to easily retrieve the corresponding trace ID when there is no parent trace to go off of, then there is a tracking issue in the spec for this: open-telemetry/opentelemetry-specification#1355 but from I can tell there is no consensus yet. If we do decide to implement these changes, I would personally want it to be opt-in only. |
|
@herin049 You’re correct that trace headers are propagated to the Lambda, but the issue occurs on the response path: when using API Gateway v2 or ALB integrations, the generated trace context is not returned to the client, so the client never receives the trace ID and this is particularly problematic when no incoming trace parent exists. I’ve corrected my implementation to use |
|
Ok, I don't really see how this issue is limited to API GW/ALBs though, even if you invoke a lambda function normally with no parent context, you also won't get a reference trace ID back. Either way, approach look OK to me. |
...ion/opentelemetry-instrumentation-aws-lambda/tests/test_aws_lambda_instrumentation_manual.py
Outdated
Show resolved
Hide resolved
...ion/opentelemetry-instrumentation-aws-lambda/tests/test_aws_lambda_instrumentation_manual.py
Show resolved
Hide resolved
|
@herin049 API Gateway v1 automagically adds the |
|
Changes LGTM! |
Description
Automatically inject trace headers in AWS Lambda responses. Fixes #4074
Type of change
How Has This Been Tested?
Does This PR Require a Core Repo Change?