Skip to content

ASGI instrumentation metrics don't align with the semantic conventions #3310

@liinie

Description

@liinie

Describe your environment

OS: (Linux, MacOS)
Python version: (Python 3.8)
Package version: (0.50b0, 0.51b0)

What happened?

the _set_http_net_host method is implemented in _semconv.py to align with Semantic Conventions (v1.30.0), enabling the extraction of server.address in opt_in mode (see semconv doc) for the http.server.request.duration metric. However, this method is never imported in the ASGI instrumentation package (see instrumentation/asgi/init.py), making the server.address attribute unavailable.
Please fix this issue or provide a workaround to extract the http server name when using http.server.request.duration metric for ASGI instrumentation.

Steps to Reproduce

the _set_http_net_host could be added here

Expected Result

server.address is enabled for http.server.request.duration

Actual Result

server.address doesn't work even in opt-in mode

Additional context

No response

Would you like to implement a fix?

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions