opentelemetry-python-contrib
opentelemetry-python-contrib copied to clipboard
fix(opentelemetry-instrumentation-asgi): Correct http.url attribute generation
Description
Correct http.url and http.target attribute generation even with sub apps (fixes #2476)
- modify the instrumentation logic
- add unittests on starlette instrumentation
- add unittests on fastapi instrumentation
Fixes #2476
Type of change
Please delete options that are not relevant.
- [x] Bug fix (non-breaking change which fixes an issue)
From my point of view existing logic won't break. Simply attributes generated will change according to their correct intended values.
How Has This Been Tested?
- See the corresponding bug #2476 using the apps there, and the proposed fix, it can be verified working
- The pr contains unit tests to cover such situations as well.
Does This PR Require a Core Repo Change?
- [x] No.
Checklist:
See contributing.md for styleguide, changelog guidelines, and more.
- [x] Followed the style guidelines of this project
- [x] Changelogs have been updated
- [x] Unit tests have been added
- [x] Documentation has been updated (imho not required)
pylint forced me to split the fastapi instrumentation tests, therefore I made a split into two files
pipeline is already running 100% green within my fork, so its safe to approve workflows
@samuelcolvin any chance you could take a look at this?
I'll check this today.
@Kludex it would be great if you can take a look at this, thanks
I don't think that amount of explanation is needed, besides a link to the docs, or issue on asgiref, but besides that... All good. 👍
Changed the comments to prevent non required verbosity :)
Refactored as suggested and rebased to main
rebased to main :)
@dhofstetter
Could you rebase again? Seems like the pr does not allow for maintainer edits.
@lzchen Rebase done
@dhofstetter
The pr always needs rebasing if a different change gets merged. I suggest allowing maintainer edits on this branch or else we will have to continuously follow up with you.
@dhofstetter
The pr always needs rebasing if a different change gets merged. I suggest allowing maintainer edits on this branch or else we will have to continuously follow up with you.
The thing is ... well tell me where to setup what, s.t. maintainers can edit :D I was/am not aware that I prevent that