Skip to content

Commit

Permalink
Fix AttributeError: ResolverMatch object has no attribute route (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
srikanthccv committed Jul 14, 2021
1 parent 2ccf120 commit df0ca3b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `opentelemetry-instrumentation-requests` Fix potential `AttributeError` when `requests`
is used with a custom transport adapter.
([#562](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/562))
- `opentelemetry-instrumentation-django` Fix AttributeError: ResolverMatch object has no attribute route
([#581](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/581))

### Added
- `opentelemetry-instrumentation-httpx` Add `httpx` instrumentation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,9 @@ def process_view(self, request, view_func, *args, **kwargs):
span = request.META[self._environ_span_key]

if span.is_recording():
match = getattr(request, "resolver_match")
match = getattr(request, "resolver_match", None)
if match:
route = getattr(match, "route")
route = getattr(match, "route", None)
if route:
span.set_attribute(SpanAttributes.HTTP_ROUTE, route)

Expand Down

0 comments on commit df0ca3b

Please sign in to comment.