diff --git a/api/extensions/ext_otel.py b/api/extensions/ext_otel.py index fce5736032..f27e467801 100644 --- a/api/extensions/ext_otel.py +++ b/api/extensions/ext_otel.py @@ -66,12 +66,20 @@ def init_app(app: DifyApp): exporter = GRPCSpanExporter( endpoint=endpoint, # Header field names must consist of lowercase letters, check RFC7540 - headers=((("authorization", f"Bearer {dify_config.OTLP_API_KEY}"),) if dify_config.OTLP_API_KEY else None), + headers=( + ( + ("authorization", f"Bearer {dify_config.OTLP_API_KEY}"), + ) if dify_config.OTLP_API_KEY else None + ), insecure=insecure, ) metric_exporter = GRPCMetricExporter( endpoint=endpoint, - headers=((("authorization", f"Bearer {dify_config.OTLP_API_KEY}"),) if dify_config.OTLP_API_KEY else None), + headers=( + ( + ("authorization", f"Bearer {dify_config.OTLP_API_KEY}"), + ) if dify_config.OTLP_API_KEY else None + ), insecure=insecure, ) else: diff --git a/api/tasks/ops_trace_task.py b/api/tasks/ops_trace_task.py index 5b61e9e7a1..3d3a9755a5 100644 --- a/api/tasks/ops_trace_task.py +++ b/api/tasks/ops_trace_task.py @@ -51,7 +51,7 @@ def process_trace_tasks(file_info): try: EnterpriseOtelTrace().trace(trace_info) except Exception: - logger.warning("Enterprise trace failed for app_id: %s", app_id, exc_info=True) + logger.exception("Enterprise trace failed for app_id: %s", app_id) if trace_instance: with current_app.app_context():