You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Also the implementation of ASGI instrumentation, parse attributes for both metrics (duration and active_requests) after the addition of additional attributes (where the http.routes comes):
Is your feature request related to a problem?
Maybe the inclusion of path or route attributes, could be usefull for metrics analysis.
Describe the solution you'd like
Move the additional attributes update in the ASGI instrumentation, after the call of recommended attributes for metrics.
Describe alternatives you've considered
Manually instrumentation of all paths in the API.
The text was updated successfully, but these errors were encountered:
That feature would be great! However, it's not straightforward to do it, as that label should have low multiplicity. Unfortunately the data to build the target is not standard and different frameworks expose different data in the asgi scope.
For fastapi/starlette that target can be obtained as:
scope["route"].path_format
In Sanic I couldn't find any data that could serve generating the target. Below is a print of what the scope looks like in sanic.
Does path_format return the desired value and low cardinal? If so, feel free to send a patch. The target full URL is already available (example here used in traces) but it doesn't satisfy the cardinality requirements so we haven't added that for metric labels.
There is a way to get the http.route included in autoinstrumented metrics for FastAPI?
Looking the following docs: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/semantic_conventions/http-metrics.md#parameterized-attributes
But the implementation of the recommended attributes doesn't include the http.route attribute:
opentelemetry-python-contrib/util/opentelemetry-util-http/src/opentelemetry/util/http/__init__.py
Lines 30 to 48 in 18e056b
opentelemetry-python-contrib/util/opentelemetry-util-http/src/opentelemetry/util/http/__init__.py
Lines 152 to 165 in 18e056b
Also the implementation of ASGI instrumentation, parse attributes for both metrics (duration and active_requests) after the addition of additional attributes (where the http.routes comes):
opentelemetry-python-contrib/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py
Lines 446 to 450 in 3c24adf
Is your feature request related to a problem?
Maybe the inclusion of path or route attributes, could be usefull for metrics analysis.
Describe the solution you'd like
Move the additional attributes update in the ASGI instrumentation, after the call of recommended attributes for metrics.
Describe alternatives you've considered
Manually instrumentation of all paths in the API.
The text was updated successfully, but these errors were encountered: