Skip to content

Commit

Permalink
Change HTTP_ROUTE import module
Browse files Browse the repository at this point in the history
  • Loading branch information
GonzaloGuasch committed Jul 19, 2024
1 parent d4a3141 commit 588199d
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ def response_hook(span: Span, status: str, response_headers: List):
)
from opentelemetry.instrumentation.utils import _start_internal_or_server_span
from opentelemetry.metrics import get_meter
from opentelemetry.semconv.attributes.http_attributes import HTTP_ROUTE
from opentelemetry.semconv.metrics import MetricInstruments
from opentelemetry.semconv.metrics.http_metrics import (
HTTP_SERVER_REQUEST_DURATION,
Expand Down Expand Up @@ -408,8 +409,8 @@ def _start_response(status, response_headers, *args, **kwargs):
)

if wrapped_app_environ.get(_ENVIRON_REQUEST_ROUTE_KEY, None):
duration_attrs_new[SpanAttributes.HTTP_ROUTE] = (
wrapped_app_environ.get(_ENVIRON_REQUEST_ROUTE_KEY)
duration_attrs_new[HTTP_ROUTE] = wrapped_app_environ.get(
_ENVIRON_REQUEST_ROUTE_KEY
)

duration_histogram_new.record(
Expand Down

0 comments on commit 588199d

Please sign in to comment.