Skip to content

Commit

Permalink
Update otel_middleware.py
Browse files Browse the repository at this point in the history
  • Loading branch information
lzchen committed Jul 29, 2024
1 parent cf94d10 commit b9f5a56
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -316,13 +316,13 @@ def process_view(self, request, view_func, *args, **kwargs):
if span.is_recording():
# http.route is present for both old and new semconv
span.set_attribute(SpanAttributes.HTTP_ROUTE, route)
duration_attrs = request.META[
self._environ_duration_attr_key
]
if _report_old(self._sem_conv_opt_in_mode):
duration_attrs[SpanAttributes.HTTP_TARGET] = route
if _report_new(self._sem_conv_opt_in_mode):
duration_attrs[HTTP_ROUTE] = route
duration_attrs = request.META[
self._environ_duration_attr_key
]

def process_exception(self, request, exception):
if self._excluded_urls.url_disabled(request.build_absolute_uri("?")):
Expand Down

0 comments on commit b9f5a56

Please sign in to comment.