llama-stack-mirror/llama_stack/providers/utils/telemetry
Dinesh Yeduguru a174938fbd
Fix telemetry to work on reinstantiating new lib cli (#761)
# What does this PR do?

Since we maintain global state in our telemetry pipeline,
reinstantiating lib cli will cause us to add duplicate span processors
causing sqlite to lock out because of constraint violations since we now
have two span processor writing to sqlite. This PR changes the telemetry
adapter for otel to only instantiate the provider once and add the span
processsors only once.

Also fixes an issue llama stack build


## Test Plan

tested with notebook at
https://colab.research.google.com/drive/1ck7hXQxRl6UvT-ijNRZ-gMZxH1G3cN2d#scrollTo=9496f75c
2025-01-14 11:31:50 -08:00
..
__init__.py kill unnecessarily large imports from telemetry init 2024-12-08 16:57:16 -08:00
dataset_mixin.py Update Telemetry API so OpenAPI generation can work (#640) 2024-12-16 13:00:14 -08:00
sqlite_trace_store.py Update Telemetry API so OpenAPI generation can work (#640) 2024-12-16 13:00:14 -08:00
trace_protocol.py Fix failing flake8 E226 check (#701) 2025-01-02 09:04:07 -08:00
tracing.py Fix telemetry to work on reinstantiating new lib cli (#761) 2025-01-14 11:31:50 -08:00