Skip to content

Commit

Permalink
Request ASGI attributes passed to Sampler (#1762)
Browse files Browse the repository at this point in the history
* Request ASGI attributes passed to Sampler

* Update changelog

* aiohttp-client test http.url

---------

Co-authored-by: Srikanth Chekuri <srikanth.chekuri92@gmail.com>
Co-authored-by: Shalev Roda <65566801+shalevr@users.noreply.github.com>
  • Loading branch information
3 people committed Apr 28, 2023
1 parent c8b0653 commit f46a6e1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
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
([#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))
- Make ASGI request span attributes available for `start_span`.
([#1762](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1762))

### Fixed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -531,15 +531,16 @@ async def __call__(self, scope, receive, send):

span_name, additional_attributes = self.default_span_details(scope)

attributes = collect_request_attributes(scope)
attributes.update(additional_attributes)
span, token = _start_internal_or_server_span(
tracer=self.tracer,
span_name=span_name,
start_time=None,
context_carrier=scope,
context_getter=asgi_getter,
attributes=attributes,
)
attributes = collect_request_attributes(scope)
attributes.update(additional_attributes)
active_requests_count_attrs = _parse_active_request_count_attrs(
attributes
)
Expand Down

0 comments on commit f46a6e1

Please sign in to comment.