This module provides recommended configuration options for AWS Lambda Instrumentation
when using AWS X-Ray. By using this configuration, trace context will automatically be extracted from incoming requests with the X-Amzn-Trace-Id
header if present. Trace context will also always be injected using the X-Amzn-Trace-Id
format into downstream requests from the Lambda function.
go get -u go.opentelemetry.io/contrib/instrumentation/github.com/aws/aws-lambda-go/otellambda/xrayconfig
Instrumentation Option | Recommended Value | Exported As |
---|---|---|
WithTracerProvider |
An sdktrace.TracerProvider configured to export in batches to an OTel Collector running locally in Lambda |
Not individually exported. Can only be used via AllRecommendedOptions() |
WithFlusher |
An otellambda.Flusher which yields before calling ForceFlush on the configured sdktrace.TracerProvider . Yielding mitigates data delays caused by asynchronous nature of batching TracerProvider when in Lambda |
Not individually exported. Can only be used via AllRecommendedOptions() |
WithEventToCarrier |
Function which reads X-Ray TraceID from Lambda environment and inserts it into a propagtation.TextMapCarrier |
Individually exported as EventToCarrier() , also included in AllRecommendedOptions() |
WithPropagator |
An xray.propagator |
Individually exported as Propagator() , also included in AllRecommendedOptions() |
- For more information on OpenTelemetry, visit: https://opentelemetry.io/
- For more about OpenTelemetry Go: https://github.com/open-telemetry/opentelemetry-go
- For help or feedback on this project, join us in GitHub Discussions
Apache 2.0 - See LICENSE for more information.