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

All flask spans are INTERNAL and belong to the same trace #4420

Open
tchowice opened this issue Feb 6, 2025 · 1 comment
Open

All flask spans are INTERNAL and belong to the same trace #4420

tchowice opened this issue Feb 6, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@tchowice
Copy link

tchowice commented Feb 6, 2025

Describe your environment

OS: Windows 10
Python version: 3.11.4
SDK version: 1.29.0
API version: 1.29.0

What happened?

All incoming flask requests end up as INTERNAL spans (instead of SERVER spans as expected), and they all belong to the same trace:

{
    "name": "GET /rolldice",
    "context": {
        "trace_id": "0x841af2901c9ca6fb2ab20041e732e198",
        "span_id": "0xe4146244abe71974",
        "trace_state": "[]"
    },
    "kind": "SpanKind.INTERNAL",
    "parent_id": "0x27645c64c6029b2e",
    "start_time": "2025-02-06T01:49:58.042586Z",
    "end_time": "2025-02-06T01:49:58.044586Z",
    "status": {
        "status_code": "UNSET"
    },
    "attributes": {
        "http.method": "GET",
        "http.server_name": "127.0.0.1",
        "http.scheme": "http",
        "net.host.name": "127.0.0.1:8080",
        "http.host": "127.0.0.1:8080",
        "net.host.port": 8080,
        "http.target": "/rolldice",
        "net.peer.ip": "127.0.0.1",
        "net.peer.port": 57591,
        "http.user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36",
        "http.flavor": "1.1",
        "http.route": "/rolldice",
        "http.status_code": 200
    },
    "events": [],
    "links": [],
    "resource": {
        "attributes": {
            "telemetry.sdk.language": "python",
            "telemetry.sdk.name": "opentelemetry",
            "telemetry.sdk.version": "1.29.0",
            "service.name": "dice-server",
            "telemetry.auto.version": "0.50b0"
        },
        "schema_url": ""
    }
}
{
    "name": "GET /rolldice",
    "context": {
        "trace_id": "0x841af2901c9ca6fb2ab20041e732e198",
        "span_id": "0xd4c9e36a7c8a5ea4",
        "trace_state": "[]"
    },
    "kind": "SpanKind.INTERNAL",
    "parent_id": "0x27645c64c6029b2e",
    "start_time": "2025-02-06T01:49:58.193224Z",
    "end_time": "2025-02-06T01:49:58.194153Z",
    "status": {
        "status_code": "UNSET"
    },
    "attributes": {
        "http.method": "GET",
        "http.server_name": "127.0.0.1",
        "http.scheme": "http",
        "net.host.name": "127.0.0.1:8080",
        "http.host": "127.0.0.1:8080",
        "net.host.port": 8080,
        "http.target": "/rolldice",
        "net.peer.ip": "127.0.0.1",
        "net.peer.port": 57592,
        "http.user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36",
        "http.flavor": "1.1",
        "http.route": "/rolldice",
        "http.status_code": 200
    },
    "events": [],
    "links": [],
    "resource": {
        "attributes": {
            "telemetry.sdk.language": "python",
            "telemetry.sdk.name": "opentelemetry",
            "telemetry.sdk.version": "1.29.0",
            "service.name": "dice-server",
            "telemetry.auto.version": "0.50b0"
        },
        "schema_url": ""
    }
}

Steps to Reproduce

Follow the instructions on https://opentelemetry.io/docs/zero-code/python/ to the letter. I didn't make any modifications.

Expected Result

Each request to /rolldice should result in a new trace. The span should be of type SERVER.

Actual Result

All incoming flask requests end up as INTERNAL spans (instead of SERVER spans as expected), and they all belong to the same trace.

Additional context

No response

Would you like to implement a fix?

None

@tchowice tchowice added the bug Something isn't working label Feb 6, 2025
@xrmx
Copy link
Contributor

xrmx commented Feb 6, 2025

@tchowice This should have already been fixed in 1.30.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants