Skip to main content

Environment Variables

TraceAgent's behavior can be customized via environment variables.

Server Configuration​

VariableDefaultDescription
TRACE_AGENT_DATABASE_URLsqlite:///./data/trace_agent.dbDatabase connection URL (SQLite or PostgreSQL)
TRACE_AGENT_SERVER_URLhttp://localhost:8000Backend URL used by the UI and SDK
TRACE_AGENT_AUDIT_METRICS_ENABLEDtrueEnables or disables audit metrics collection
TRACE_AGENT_UI_PORT8080Port where the frontend UI is exposed
TRACE_AGENT_CAPTURE_FULL_PAYLOADStrueKeep the full content of prompts and outputs as well as their summaries. Set to false to keep only summaries

OpenTelemetry Receiver​

Settings for the OTLP/HTTP receiver at POST /v1/traces. See OpenTelemetry Ingestion.

VariableDefaultDescription
TRACE_AGENT_OTLP_ENABLEDtrueTurn the receiver on or off. When off, POST /v1/traces answers 404
TRACE_AGENT_OTLP_MAX_BODY_BYTES10000000Maximum body size, measured after decompression. Larger bodies get 413

SDK / Agent Configuration​

VariableDefaultDescription
TRACE_AGENT_BASE_URLhttp://localhost:8000Server URL used by the SDK client
TRACE_AGENT_PROXY_URL(none)Proxy URL for local model connectivity
TRACE_AGENT_PROXY_TIMEOUT(none)Timeout for proxy connections
TRACE_AGENT_TEST_MODEL(none)Model name for test/example scripts

LLM Configuration (Examples)​

VariableDefaultDescription
OPENAI_BASE_URL(none)OpenAI-compatible endpoint (e.g., a local model server)
OPENAI_API_KEY(none)API key for the model provider

Example .env File​

.env
# TraceAgent Server
TRACE_AGENT_DATABASE_URL=sqlite:///./data/trace_agent.db
TRACE_AGENT_SERVER_URL=http://localhost:8000
TRACE_AGENT_AUDIT_METRICS_ENABLED=true
TRACE_AGENT_UI_PORT=8080

# Local model (OpenAI-compatible server)
OPENAI_BASE_URL=http://localhost:5000/v1
OPENAI_API_KEY=not-needed
warning

When using PostgreSQL, make sure the database exists and the connection URL includes credentials:

TRACE_AGENT_DATABASE_URL=postgresql://user:password@localhost:5432/traceagent

What's Next?​

💬 Comments