open-telemetry / open-telemetry/opentelemetry-python-contrib
Automatic instrument with `flask run` versus `python` results in `status_code` being `UNSET`
@hamzmu is already working on this.
Since Jan 18, 2024.
- Dominant language
- Python
- Stars
- 1.1k
- Forks
- 1.1k
- Avg merge
- 4d 15h
- Merged PRs (30d)
- 16
Description
Describe your environment
Python 3.9+ with OTel supported Flask/Werkzeug
Steps to reproduce
Follow the steps here https://opentelemetry.io/docs/instrumentation/python/getting-started/ and check the JSON output
What is the expected behavior?
...
"status": {
"status_code": "OK"
},
...
Like when following directions here: https://opentelemetry.io/docs/instrumentation/python/automatic/example/
What is the actual behavior?
...
"status": {
"status_code": "UNSET"
},
...
Additional context
It appears when flask run is used, the status_code is not set properly even though the HTTP status code is set properly ("http.status_code": 200). If you start the app with python it works properly.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.