Skip to content

Commit

Permalink
HH-237726 fix otel span name
Browse files Browse the repository at this point in the history
  • Loading branch information
712u3 committed Nov 14, 2024
1 parent 9f48053 commit c7e39e6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion frontik/request_integrations/telemetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ def _start_span(tracer, tornado_request) -> trace.span.Span:


def _get_default_span_name(tornado_request):
if (handler_name := request_context.get_handler_name()) is not None:
return handler_name

path = tornado_request.path
method = tornado_request.method
if method and path:
Expand Down Expand Up @@ -95,7 +98,6 @@ def _finish_span(span, dto: IntegrationDto, tornado_request: HTTPServerRequest):
span.set_attribute(SpanAttributes.HTTP_ROUTE, getattr(tornado_request, '_path_format'))
if (handler_name := request_context.get_handler_name()) is not None:
method_path, method_name = handler_name.rsplit('.', 1)
span.update_name(f'{method_path}.{method_name}')
span.set_attribute(SpanAttributes.CODE_FUNCTION, method_name)
span.set_attribute(SpanAttributes.CODE_NAMESPACE, method_path)

Expand Down

0 comments on commit c7e39e6

Please sign in to comment.