Skip to content

Commit 588199d

Browse files
committed
Change HTTP_ROUTE import module
1 parent d4a3141 commit 588199d

File tree

1 file changed

+3
-2
lines changed
  • instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask

1 file changed

+3
-2
lines changed

instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/__init__.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@ def response_hook(span: Span, status: str, response_headers: List):
266266
)
267267
from opentelemetry.instrumentation.utils import _start_internal_or_server_span
268268
from opentelemetry.metrics import get_meter
269+
from opentelemetry.semconv.attributes.http_attributes import HTTP_ROUTE
269270
from opentelemetry.semconv.metrics import MetricInstruments
270271
from opentelemetry.semconv.metrics.http_metrics import (
271272
HTTP_SERVER_REQUEST_DURATION,
@@ -408,8 +409,8 @@ def _start_response(status, response_headers, *args, **kwargs):
408409
)
409410

410411
if wrapped_app_environ.get(_ENVIRON_REQUEST_ROUTE_KEY, None):
411-
duration_attrs_new[SpanAttributes.HTTP_ROUTE] = (
412-
wrapped_app_environ.get(_ENVIRON_REQUEST_ROUTE_KEY)
412+
duration_attrs_new[HTTP_ROUTE] = wrapped_app_environ.get(
413+
_ENVIRON_REQUEST_ROUTE_KEY
413414
)
414415

415416
duration_histogram_new.record(

0 commit comments

Comments
 (0)