opentelemetry-python-contrib
opentelemetry-python-contrib copied to clipboard
Include http.target in flask instrumentation metrics attributes
trafficstars
As part of the semantic conventions, http.target should be included in the metrics attributes. However it is only present for span attributes.
https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/semantic_conventions/http-metrics.md#parameterized-attributes
Currently it isn't part of the duration_attrs. Which it probably shouldn't until there is a solution to set the value to the flask url_rule instead of the raw input request:
- caller: https://github.com/open-telemetry/opentelemetry-python-contrib/blob/main/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/init.py#L295
- callee: https://github.com/open-telemetry/opentelemetry-python-contrib/blob/main/instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/init.py#L236