Skip to content

Commit

Permalink
Pass request attributes to Sampler in Django
Browse files Browse the repository at this point in the history
  • Loading branch information
rafa-munoz committed Mar 31, 2023
1 parent 4e059b1 commit 04e5c54
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
([#1645](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1645))
- Add `excluded_urls` functionality to `urllib` and `urllib3` instrumentations
([#1733](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1733))
- Make Django request span attributes available for `start_span`.
([#1730](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1730))

### Fixed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ def process_request(self, request):
carrier_getter = wsgi_getter
collect_request_attributes = wsgi_collect_request_attributes

attributes = collect_request_attributes(carrier)
span, token = _start_internal_or_server_span(
tracer=self._tracer,
span_name=self._get_span_name(request),
Expand All @@ -220,9 +221,9 @@ def process_request(self, request):
),
context_carrier=carrier,
context_getter=carrier_getter,
attributes=attributes,
)

attributes = collect_request_attributes(carrier)
active_requests_count_attrs = _parse_active_request_count_attrs(
attributes
)
Expand Down

0 comments on commit 04e5c54

Please sign in to comment.