llama-stack/llama_stack/providers/inline
Dinesh Yeduguru 3c1a2c3d66
Fix telemetry init (#885)
# What does this PR do?

When you re-initialize the library client in a notebook, we were seeing
this error:
```
Getting traces for session_id=5c8d1969-0957-49d2-b852-32cbb8ef8caf
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
[<ipython-input-11-d74bb6cdd3ab>](https://localhost:8080/#) in <cell line: 0>()
      7 agent_logs = []
      8 
----> 9 for span in client.telemetry.query_spans(
     10     attribute_filters=[
     11         {"key": "session_id", "op": "eq", "value": session_id},

10 frames
[/usr/local/lib/python3.11/dist-packages/llama_stack/providers/inline/telemetry/meta_reference/telemetry.py](https://localhost:8080/#) in query_traces(self, attribute_filters, limit, offset, order_by)
    246     ) -> QueryTracesResponse:
    247         return QueryTracesResponse(
--> 248             data=await self.trace_store.query_traces(
    249                 attribute_filters=attribute_filters,
    250                 limit=limit,

AttributeError: 'TelemetryAdapter' object has no attribute 'trace_store'
```

This is happening because the we were skipping some required steps for
the object state as part of the global _TRACE_PROVIDER check. This PR
moves the initialization of the object state out of the TRACE_PROVIDER
init.
2025-01-27 11:20:28 -08:00
..
agents Rename builtin::memory -> builtin::rag 2025-01-22 20:22:51 -08:00
datasetio Add persistence for localfs datasets (#557) 2025-01-09 17:34:18 -08:00
eval rebase eval test w/ tool_runtime fixtures (#773) 2025-01-15 12:55:19 -08:00
inference Fix meta-reference GPU implementation for inference 2025-01-22 18:31:59 -08:00
ios/inference impls -> inline, adapters -> remote (#381) 2024-11-06 14:54:05 -08:00
post_training More idiomatic REST API (#765) 2025-01-15 13:20:09 -08:00
safety [bugfix] fix llama guard parsing ContentDelta (#772) 2025-01-15 11:20:23 -08:00
scoring Add X-LlamaStack-Client-Version, rename ProviderData -> Provider-Data (#735) 2025-01-09 11:51:36 -08:00
telemetry Fix telemetry init (#885) 2025-01-27 11:20:28 -08:00
tool_runtime Move tool_runtime.memory -> tool_runtime.rag 2025-01-22 20:25:02 -08:00
vector_io Bump key for faiss 2025-01-24 12:08:36 -08:00
__init__.py impls -> inline, adapters -> remote (#381) 2024-11-06 14:54:05 -08:00