opentelemetry-python-contrib
opentelemetry-python-contrib copied to clipboard
feat: add header extraction parameters to `FastAPIInstrumentor().instrument_app`
Description
Continuing from the work done in https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2026 by @adriangb, this adds three new keyword parameters to FastAPIInstrumentor().instrument_app:
http_capture_headers_server_requesthttp_capture_headers_server_responsehttp_capture_headers_sanitize_fields
All of course have the same meaning and behavior as in the asgi OpenTelemetryMiddleware - they're just passed straight through to that middleware.
Type of change
Please delete options that are not relevant.
- [x] New feature (non-breaking change which adds functionality)
How Has This Been Tested?
Added TestHTTPAppWithCustomHeadersParameters
Does This PR Require a Core Repo Change?
- [ ] Yes. - Link to PR:
- [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
sorry about that, linting fixed hopefully.
Lgtm too. Please could you fix the Changelog merge conflict that popped up after the 1.23.0 release.
Lgtm too. Please could you fix the Changelog merge conflict that popped up after the 1.23.0 release.
Thanks, done.
@lzchen I've corrected those things.