You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a python 3.8 lambda instrumented with a aws layer. This lambda is using the FastAPI ASGI framework wrapped by the Mangum Lambda+API Gateway adapter.
I'm currently running into issues where the xray exporter is consistently erroring on Error translating span: invalid xray traceid for all spans not related to the lambda startup events.
Is there something that i'm missing somewhere ? I tried multiple variations of the code and the one that always fails is when i'm using the Mangum adapter. However i can't remove that since it's handling AWS API Gateway requests and responses. Is there something in addition to the fastapi guide that i should be implementing to get around this issue ?
Lambda
Layer version: aws-otel-python38-ver-1-7-1:1 (Contains OpenTelemetry Python v1.7.1 with the AWS Python Extension v1.0.1)
The lambda is a invoked by an AWS Gateway configured to proxy requests
"""Main API handler that defines all routes."""importboto3importosfromfastapiimportFastAPIfrommangumimportMangumfromopentelemetry.instrumentation.fastapiimportFastAPIInstrumentorapp=FastAPI(
title="AWS + FastAPI",
description="AWS API Gateway, Lambdas and FastAPI (oh my)",
root_path="/dev"
)
@app.get("/hello")defhello():
"Hello path request"return {"Hello": "World"}
@app.get("/list")defhello():
client=boto3.client("s3")
client.list_buckets()
client=boto3.client("ec2")
client.describe_instances()
return {"Region ": os.environ['AWS_REGION']}
FastAPIInstrumentor.instrument_app(app)
# Mangum allows us to use Lambdas to process requestshandler=Mangum(app=app)
After some further documentation reading i noticed i was missing the below environment variables so the default provider was using the random id generator instead of the xray one. Putting them below in-case others run into a similar issue in the future when using xray as an exporter. Going to close this issue.
I have a python 3.8 lambda instrumented with a aws layer. This lambda is using the FastAPI ASGI framework wrapped by the Mangum Lambda+API Gateway adapter.
I'm currently running into issues where the xray exporter is consistently erroring on
Error translating span: invalid xray traceid
for all spans not related to the lambda startup events.Is there something that i'm missing somewhere ? I tried multiple variations of the code and the one that always fails is when i'm using the Mangum adapter. However i can't remove that since it's handling AWS API Gateway requests and responses. Is there something in addition to the fastapi guide that i should be implementing to get around this issue ?
error demo repo
Lambda
Layer version: aws-otel-python38-ver-1-7-1:1 (Contains OpenTelemetry Python v1.7.1 with the AWS Python Extension v1.0.1)
The lambda is a invoked by an AWS Gateway configured to proxy requests
default collector config modified to add debugging.
Code to test opentelemetry auto-instrumentation
Requirements file
Collector config
Debug logs...
The text was updated successfully, but these errors were encountered: