mirror of
https://github.com/langgenius/dify.git
synced 2026-05-09 12:59:18 +08:00
Update api/extensions/otel/runtime.py
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
parent
a28cb993b8
commit
4f5af0b43c
@ -44,8 +44,10 @@ def flush_telemetry() -> None:
|
||||
"""
|
||||
provider = trace.get_tracer_provider()
|
||||
if hasattr(provider, "force_flush"):
|
||||
with contextlib.suppress(Exception):
|
||||
try:
|
||||
provider.force_flush()
|
||||
except Exception:
|
||||
logger.exception("otel: failed to flush trace provider")
|
||||
|
||||
metric_provider = metrics.get_meter_provider()
|
||||
if hasattr(metric_provider, "force_flush"):
|
||||
|
||||
Loading…
Reference in New Issue
Block a user