mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-16 23:41:43 +00:00
Fix duplicate trace (#15931)
Co-authored-by: eycjur <eycjur@example.com>
This commit is contained in:
parent
70650a044c
commit
75b5624b32
1 changed files with 5 additions and 3 deletions
|
|
@ -186,9 +186,11 @@ class OpenTelemetry(CustomLogger):
|
|||
)
|
||||
return
|
||||
|
||||
# Add Otel as a service callback
|
||||
if "otel" not in litellm.service_callback:
|
||||
litellm.service_callback.append("otel")
|
||||
# Add self as a service callback
|
||||
if "otel" not in litellm.service_callback and all(
|
||||
not isinstance(cb, OpenTelemetry) for cb in litellm.service_callback
|
||||
):
|
||||
litellm.service_callback.append(self)
|
||||
setattr(proxy_server, "open_telemetry_logger", self)
|
||||
|
||||
def _init_tracing(self, tracer_provider):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue