Skip to content

Commit 0199858

Browse files
Fix: custom attrs Flask to request_counter, not span
1 parent 4eeecf6 commit 0199858

File tree

1 file changed

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

1 file changed

+4
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,10 @@ def _wrapped_app(wrapped_app_environ, start_response):
380380
sem_conv_opt_in_mode,
381381
)
382382
)
383+
# Enhance attributes with any custom labeler attributes
384+
active_requests_count_attrs = enhance_metric_attributes(
385+
active_requests_count_attrs
386+
)
383387

384388
active_requests_counter.add(1, active_requests_count_attrs)
385389
request_route = None
@@ -485,8 +489,6 @@ def _before_request():
485489
flask_request_environ,
486490
sem_conv_opt_in_mode=sem_conv_opt_in_mode,
487491
)
488-
# Enhance attributes with custom labeler attributes
489-
attributes = enhance_metric_attributes(attributes)
490492
if flask.request.url_rule:
491493
# For 404 that result from no route found, etc, we
492494
# don't have a url_rule.

0 commit comments

Comments
 (0)