[Python] How can I solve the "unexpected namespace: local" xray issue?

Discussão em 'Python' iniciado por Stack, Janeiro 23, 2025.

  1. Stack

    Stack Membro Participativo

    I'm running an xray daemon on an ec2-backed ecs cluster, and I'm getting this in the xray daemon's cloudwatch logs:


    warn awsxrayreceiver@v0.78.0/receiver.go:116 X-Ray segment to OT traces conversion failed {"kind": "receiver", "name": "awsxray", "data_type": "traces", "error": "unexpected namespace: local"}
    ​

    This is somehow caused by a python flask app instrumented with xray. There must be some configuration that I'm missing for this? Maybe I'm also missing a configuration in xray somewhere too?

    What environment variable or other configuration change can I make to fix this problem?

    In case it is interesting, I do see traces and trace maps despite the warnings.


    Python code:

    requirements:

    aws-xray-sdk


    app.py:

    from aws_xray_sdk.core import xray_recorder # type: ignore
    from aws_xray_sdk.ext.flask.middleware import XRayMiddleware # type: ignore
    ...
    app = Flask(__name__)
    ...
    xray_recorder.configure(service="helloworld")
    XRayMiddleware(app, xray_recorder)


    environment variables:

    AWS_XRAY_DAEMON_ADDRESS="172.17.0.1:2000"


    For the xray daemon, I am using public.ecr.aws/aws-observability/aws-otel-collector:v0.30.0 as the image, and no environment variables or command overrides

    Continue reading...

Compartilhe esta Página