RequestsInstrumentor metrics attributes exclude http.response.status_code
if not sampled
#3261
Labels
bug
Something isn't working
Describe your environment
OS: Ubuntu
Python version: Python 3.10.16
Package version: 1.30.0/0.51b0
What happened?
I have manually instrumented a Flask app with an always-off sampler. My test app uses
requests
library to make outgoing request that always returns 200.requests
is instrumented and generates the metrichttp.client.request.duration
with these attributes:but it is missing
"http.response.status_code": 200
Steps to Reproduce
Run script and make a request to localhost/test_trace
Expected Result
The metric
http.client.request.duration
should have these attributes:Actual Result
Additional context
https://github.com/open-telemetry/opentelemetry-python-contrib/blob/main/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/__init__.py#L276
Would you like to implement a fix?
None
The text was updated successfully, but these errors were encountered: