From 20a97f8c80d02a08f30c046a9554acbb0657e6c5 Mon Sep 17 00:00:00 2001 From: GuanMu Date: Sun, 4 May 2025 14:28:28 +0000 Subject: [PATCH] feat: add meter instance retrieval in ext_otel.py for HTTP client metrics --- api/extensions/ext_otel.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/api/extensions/ext_otel.py b/api/extensions/ext_otel.py index 406ac9b168..d7118cda98 100644 --- a/api/extensions/ext_otel.py +++ b/api/extensions/ext_otel.py @@ -184,6 +184,9 @@ def init_app(app: DifyApp): ) set_meter_provider(MeterProvider(resource=resource, metric_readers=[reader])) + # Get a meter instance + meter = get_meter(__name__) + # Define the counter metric for HTTP client requests _http_client_response_counter = meter.create_counter( name="http.client.request.count",