llama-stack-mirror/llama_stack/distribution/server
Dinesh Yeduguru 86f617a197
fix: tracing middleware to not start for lifespan events (#1730)
# What does this PR do?
Tracing middleware should not start tracing for lifespan events.
Lifespan event happens at server startup and shutdown and if we start
tracing for them, we will have an active trace for the lifetime of the
server, which messes up with regular tracing since we always expect the
traces to be never nested.

We started hitting this issue since
https://github.com/meta-llama/llama-stack/pull/1495.

## Test Plan
* llama stack run ~/.llama/distributions/fireworks/fireworks-run.yaml
* Verify in sqlite store that the trace now has non null span id
![Screenshot 2025-03-20 at 1 49
47 PM](https://github.com/user-attachments/assets/d77354a7-d5f1-4b53-a946-6adbd7a4f772)
2025-03-20 14:22:19 -07:00
..
__init__.py API Updates (#73) 2024-09-17 19:51:35 -07:00
auth.py feat(server): add attribute based access control for resources (#1703) 2025-03-19 21:28:52 -07:00
endpoints.py build: format codebase imports using ruff linter (#1028) 2025-02-13 10:06:21 -08:00
server.py fix: tracing middleware to not start for lifespan events (#1730) 2025-03-20 14:22:19 -07:00