Skip to content

Flask spans should be kind Server #3171

Closed
@tammy-baylis-swi

Description

@tammy-baylis-swi

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions