Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

fix(api): resolve OpenTelemetry histogram type mismatch (#32771)

Br1an2b47db0462ae
diff --git a/api/core/ops/tencent_trace/client.py b/api/core/ops/tencent_trace/client.py
index 99ccf004009..c39093bf4c9 100644
--- a/api/core/ops/tencent_trace/client.py
+++ b/api/core/ops/tencent_trace/client.py
@@ -120,7 +120,8 @@ class TencentTraceClient:
# Metrics exporter and instruments
try:
- from opentelemetry.sdk.metrics import Histogram, MeterProvider
+ from opentelemetry.sdk.metrics import Histogram as SdkHistogram
+ from opentelemetry.sdk.metrics import MeterProvider
from opentelemetry.sdk.metrics.export import AggregationTemporality, PeriodicExportingMetricReader
protocol = os.getenv("OTEL_EXPORTER_OTLP_PROTOCOL", "").strip().lower()
@@ -128,7 +129,7 @@ class TencentTraceClient:
use_http_json = protocol in {"http/json", "http-json"}
# Tencent APM works best with delta aggregation temporality
- preferred_temporality: dict[type, AggregationTemporality] = {Histogram: AggregationTemporality.DELTA}
+ preferred_temporality: dict[type, AggregationTemporality] = {SdkHistogram: AggregationTemporality.DELTA}
def _create_metric_exporter(exporter_cls, **kwargs):
"""Create metric exporter with preferred_temporality support"""