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 27, 2023
1 parent e4d8f10 commit 8c45979
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
([#1690](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1690))
- Add metrics instrumentation for sqlalchemy
([#1645](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1645))
- Make requests span attributes available to Django sampler
([#1645](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1645))


### 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 8c45979

Please sign in to comment.