Skip to content

Commit

Permalink
change flask variable str method
Browse files Browse the repository at this point in the history
  • Loading branch information
GonzaloGuasch committed Jul 19, 2024
1 parent cea918d commit 122ca57
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ def _start_response(status, response_headers, *args, **kwargs):
):
if flask.request.url_rule:
nonlocal request_route
request_route = str(flask.request.url_rule)
request_route = flask.request.url_rule

span = flask.request.environ.get(_ENVIRON_SPAN_KEY)

Expand Down Expand Up @@ -396,7 +396,9 @@ def _start_response(status, response_headers, *args, **kwargs):
)

if request_route:
duration_attrs_old[SpanAttributes.HTTP_TARGET] = request_route
duration_attrs_old[SpanAttributes.HTTP_TARGET] = str(
request_route
)

duration_histogram_old.record(
max(round(duration_s * 1000), 0), duration_attrs_old
Expand All @@ -407,7 +409,7 @@ def _start_response(status, response_headers, *args, **kwargs):
)

if request_route:
duration_attrs_new[HTTP_ROUTE] = request_route
duration_attrs_new[HTTP_ROUTE] = str(request_route)

duration_histogram_new.record(
max(duration_s, 0), duration_attrs_new
Expand Down

0 comments on commit 122ca57

Please sign in to comment.