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

Flask spans should be kind Server #3171

Open
tammy-baylis-swi opened this issue Jan 6, 2025 · 2 comments · May be fixed by #3174
Open

Flask spans should be kind Server #3171

tammy-baylis-swi opened this issue Jan 6, 2025 · 2 comments · May be fixed by #3174
Assignees
Labels
bug Something isn't working

Comments

@tammy-baylis-swi
Copy link
Contributor

tammy-baylis-swi commented Jan 6, 2025

Describe your environment

OS: Ubuntu
Python version: 3.12
Package version: 0.50b0

What happened?

I would expect this span to have Kind: Server instead of Kind: Internal after request to a basic, instrumented Flask app launched by opentelemetry-instrument flask run:

2025-01-06T23:29:42.496Z	info	TracesExporter	{"kind": "exporter", "data_type": "traces", "name": "logging", "resource spans": 1, "spans": 1}
2025-01-06T23:29:42.496Z	info	ResourceSpans #0
Resource SchemaURL:
Resource attributes:
     -> telemetry.sdk.language: Str(python)
     -> telemetry.sdk.name: Str(opentelemetry)
     -> telemetry.sdk.version: Str(1.29.0)
     -> telemetry.auto.version: Str(0.50b0)
     -> service.name: Str(unknown_service)
ScopeSpans #0
ScopeSpans SchemaURL:
InstrumentationScope opentelemetry.instrumentation.flask 0.50b0
Span #0
    Trace ID       : 3977b5d8f3b663897f664456ee212a42
    Parent ID      : 9d116dd89e7d01ea
    ID             : 65fe6179504e52e5
    Name           : GET /abc/
    Kind           : Internal
    Start time     : 2025-01-06 23:29:39.687706593 +0000 UTC
    End time       : 2025-01-06 23:29:39.689165051 +0000 UTC
    Status code    : Unset
    Status message :
Attributes:
     -> http.method: Str(GET)
     -> http.server_name: Str(0.0.0.0)
     -> http.scheme: Str(http)
     -> net.host.name: Str(0.0.0.0:8033)
     -> http.host: Str(0.0.0.0:8033)
     -> net.host.port: Int(8033)
     -> http.target: Str(/abc/)
     -> net.peer.ip: Str(172.19.0.1)
     -> net.peer.port: Int(60052)
     -> http.user_agent: Str(curl/8.11.1)
     -> http.flavor: Str(1.1)
     -> http.route: Str(/abc/)
     -> http.status_code: Int(200)

Steps to Reproduce

pip install opentelemetry-distro==0.50b0 opentelemetry-exporter-otlp==1.29.0
opentelemetry-bootstrap --action=install
opentelemetry-instrument flask run

Expected Result

Kind: Server

Actual Result

Kind: Internal

Additional context

Related to a feature introduced in #828

Would you like to implement a fix?

None

@emdneto
Copy link
Member

emdneto commented Jan 7, 2025

I investigated a bit, and it happens when having click+flask instrumentation when you start the application with: flask run. Probably the solution for #3172 will solve this too

@xrmx
Copy link
Contributor

xrmx commented Jan 7, 2025

I investigated a bit, and it happens when having click+flask instrumentation when you start the application with: flask run. Probably the solution for #3172 will solve this too

Yep, that's the very same underlying issue

@xrmx xrmx linked a pull request Jan 7, 2025 that will close this issue
11 tasks
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

Successfully merging a pull request may close this issue.

3 participants