The integration-tests.sh script already sets LLAMA_STACK_TEST_STACK_CONFIG_TYPE
based on the stack config. Our custom detection logic was unnecessary and
potentially interfering. Revert to relying on the environment variable set
by the test script.
The LLAMA_STACK_DISABLE_GUNICORN environment variable is still set correctly
when stack_mode == 'server', which happens for both server: and docker: configs.
The telemetry fixture was only checking LLAMA_STACK_TEST_STACK_CONFIG_TYPE
environment variable, which defaults to 'library_client'. In CI, tests run
with --stack-config=docker:ci-tests, which wasn't being detected as server mode.
This commit checks the --stack-config argument and treats both 'server:' and
'docker:' prefixes as server mode, ensuring LLAMA_STACK_DISABLE_GUNICORN is
set when needed for telemetry span collection.
Telemetry tests use an OTLP collector that expects single-process
telemetry spans. Gunicorn's multi-process architecture spawns multiple
workers, each with separate telemetry instrumentation, preventing the
test collector from capturing all spans.
This commit adds LLAMA_STACK_DISABLE_GUNICORN environment variable
support and sets it in telemetry test configuration to ensure
single-process Uvicorn is used during tests while maintaining
production multi-process behavior.
Fixes failing tests:
- test_streaming_chunk_count
- test_telemetry_format_completeness
# What does this PR do?
Clean up telemetry code since the telemetry API has been remove.
- moved telemetry files out of providers to core
- removed from Api
## Test Plan
❯ OTEL_SERVICE_NAME=llama_stack
OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318 uv run llama stack run
starter
❯ curl http://localhost:8321/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-4o-mini",
"messages": [
{
"role": "user",
"content": "Hello!"
}
]
}'
-> verify traces in Grafana
CI
# What does this PR do?
Adds a test and a standardized way to build future tests out for
telemetry in llama stack.
Contributes to https://github.com/llamastack/llama-stack/issues/3806
## Test Plan
This is the test plan 😎