From 0e11c297574da09ced593ea7dcc599b4cac384ca Mon Sep 17 00:00:00 2001 From: GuanMu Date: Sun, 4 May 2025 14:11:36 +0000 Subject: [PATCH] style: standardize string quotes in ext_otel.py for consistency --- api/extensions/ext_otel.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/api/extensions/ext_otel.py b/api/extensions/ext_otel.py index bd2a148c26..40d793bb51 100644 --- a/api/extensions/ext_otel.py +++ b/api/extensions/ext_otel.py @@ -201,8 +201,8 @@ def init_app(app: DifyApp): _http_client_response_counter.add(1, {"status_code": status_code, "status_class": status_class}) # Only record the URL path attribute - if hasattr(request, 'path_url'): # For requests.PreparedRequest - path = request.path_url.split('?', 1)[0] # Get path before query string + if hasattr(request, "path_url"): # For requests.PreparedRequest + path = request.path_url.split("?", 1)[0] # Get path before query string span.set_attribute(SpanAttributes.URL_PATH, path) RequestsInstrumentor().instrument(response_hook=outgoing_requests_response_hook) @@ -224,12 +224,11 @@ def init_app(app: DifyApp): _http_client_response_counter.add(1, {"status_code": status_code, "status_class": status_class}) # Only record the URL path attribute - if hasattr(request, 'url') and hasattr(request.url, 'path'): # For httpx.Request + if hasattr(request, "url") and hasattr(request.url, "path"): # For httpx.Request span.set_attribute(SpanAttributes.URL_PATH, request.url.path) HTTPXClientInstrumentor().instrument(response_hook=outgoing_httpx_response_hook) - # Initialize instrumentors if not is_celery_worker(): init_flask_instrumentor(app) @@ -237,7 +236,7 @@ def init_app(app: DifyApp): instrument_exception_logging() init_sqlalchemy_instrumentor(app) init_requests_instrumentor() - init_httpx_instrumentor() + init_httpx_instrumentor() atexit.register(shutdown_tracer)