Skip to content

Commit

Permalink
Merge branch 'main' into fix-async-redis-client-tracing
Browse files Browse the repository at this point in the history
  • Loading branch information
Vivanov98 authored Jun 16, 2023
2 parents 159d514 + 7292bee commit d66a469
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

### Fixed
### Added

- Fix async redis clients not being traced correctly ([#1830](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1830))
- Make Flask request span attributes available for `start_span`.
([#1784](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1784))
- Fix falcon instrumentation's usage of Span Status to only set the description if the status code is ERROR.
([#1840](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1840))
- Instrument all httpx versions >= 0.18. ([#1748](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1748))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -375,27 +375,26 @@ def _before_request():
flask_request_environ = flask.request.environ
span_name = get_default_span_name()

attributes = otel_wsgi.collect_request_attributes(
flask_request_environ
)
if flask.request.url_rule:
# For 404 that result from no route found, etc, we
# don't have a url_rule.
attributes[SpanAttributes.HTTP_ROUTE] = flask.request.url_rule.rule
span, token = _start_internal_or_server_span(
tracer=tracer,
span_name=span_name,
start_time=flask_request_environ.get(_ENVIRON_STARTTIME_KEY),
context_carrier=flask_request_environ,
context_getter=otel_wsgi.wsgi_getter,
attributes=attributes,
)

if request_hook:
request_hook(span, flask_request_environ)

if span.is_recording():
attributes = otel_wsgi.collect_request_attributes(
flask_request_environ
)
if flask.request.url_rule:
# For 404 that result from no route found, etc, we
# don't have a url_rule.
attributes[
SpanAttributes.HTTP_ROUTE
] = flask.request.url_rule.rule
for key, value in attributes.items():
span.set_attribute(key, value)
if span.is_recording() and span.kind == trace.SpanKind.SERVER:
Expand Down

0 comments on commit d66a469

Please sign in to comment.