Configuration
BothSingle source of truth for all Traccia configuration options and environment variables.
This page documents every configuration option available in Traccia, including config file sections, environment variables, and default values.
Configuration Precedence
Traccia merges configuration from multiple sources. When the same option is set in multiple places, the following priority applies (highest to lowest):
- 1Explicit parameters — passed to
init()orstart_tracing() - 2Environment variables —
TRACCIA_*orAGENT_DASHBOARD_* - 3Config file —
./traccia.tomlor~/.traccia/config.toml - 4Defaults — Built-in SDK defaults
Example: If you set TRACCIA_ENDPOINT in your environment and pass endpoint="..." to init(), the explicit parameter wins.
The default endpoint is the Traccia platform (https://api.traccia.ai/v2/traces). Override it only when using a custom OTLP backend.
Platform HTTP/gRPC endpoints
[tracing]
| Option | Type | Default | Environment Variables |
|---|---|---|---|
api_key | string | None | TRACCIA_API_KEY, AGENT_DASHBOARD_API_KEY |
endpoint | string | https://api.traccia.ai/v2/traces (Traccia platform) | TRACCIA_ENDPOINT, AGENT_DASHBOARD_ENDPOINT |
sample_rate | float | 1.0 | TRACCIA_SAMPLE_RATE, AGENT_DASHBOARD_SAMPLE_RATE |
auto_start_trace | bool | true | TRACCIA_AUTO_START_TRACE, AGENT_DASHBOARD_AUTO_START_TRACE |
auto_trace_name | string | "root" | TRACCIA_AUTO_TRACE_NAME |
use_otlp | bool | true | TRACCIA_USE_OTLP |
service_name | string | auto-detected | TRACCIA_SERVICE_NAME |
service_role | string? | None | — |
service_name is auto-detected when not set. Python falls back to the script name or working directory. Node.js also checks OTEL_SERVICE_NAME, SERVICE_NAME, and TRACCIA_SERVICE_NAME. Pass service_role programmatically: init(service_role="orchestrator"). Use it for multi-agent host services so the host itself is not registered as an agent in the platform.
[exporters]
| Option | Type | Default | Environment Variables |
|---|---|---|---|
enable_console | bool | false | TRACCIA_ENABLE_CONSOLE, AGENT_DASHBOARD_ENABLE_CONSOLE_EXPORTER |
enable_file | bool | false | TRACCIA_ENABLE_FILE, AGENT_DASHBOARD_ENABLE_FILE_EXPORTER |
file_exporter_path | string | "traces.jsonl" | TRACCIA_FILE_PATH |
reset_trace_file | bool | false | TRACCIA_RESET_TRACE_FILE |
Exporter configuration
traccia.toml, do not enable both enable_console and enable_file. OTLP is controlled separately via use_otlp and can be combined with console or file when initializing programmatically.[instrumentation]
| Option | Type | Default | Environment Variables |
|---|---|---|---|
enable_patching | bool | true | TRACCIA_ENABLE_PATCHING, AGENT_DASHBOARD_ENABLE_PATCHING |
enable_token_counting | bool | true | TRACCIA_ENABLE_TOKEN_COUNTING, AGENT_DASHBOARD_ENABLE_TOKEN_COUNTING |
enable_costs | bool | true | TRACCIA_ENABLE_COSTS, AGENT_DASHBOARD_ENABLE_COSTS |
auto_instrument_tools | bool | false | TRACCIA_AUTO_INSTRUMENT_TOOLS |
max_tool_spans | int | 100 | TRACCIA_MAX_TOOL_SPANS |
max_span_depth | int | 10 | TRACCIA_MAX_SPAN_DEPTH |
openai_agents | bool | true | TRACCIA_OPENAI_AGENTS |
crewai | bool | true | TRACCIA_CREWAI |
[metrics]
| Option | Type | Default | Environment Variables |
|---|---|---|---|
enable_metrics | bool | true | TRACCIA_ENABLE_METRICS |
metrics_endpoint | string | Derived from tracing endpoint ({traces_base}/v2/metrics) | TRACCIA_METRICS_ENDPOINT |
metrics_sample_rate | float | 1.0 | TRACCIA_METRICS_SAMPLE_RATE |
Metrics are emitted even when traces are heavily sampled, so you can keep sample_rate low for traces while keeping metrics_sample_rate at 1.0 for accurate cost and token usage.
[rate_limiting]
| Option | Type | Default | Environment Variables |
|---|---|---|---|
max_spans_per_second | float? | None | TRACCIA_MAX_SPANS_PER_SECOND |
max_queue_size | int | 5000 | TRACCIA_MAX_QUEUE_SIZE |
max_block_ms | int | 100 | TRACCIA_MAX_BLOCK_MS |
max_export_batch_size | int | 512 | TRACCIA_MAX_EXPORT_BATCH_SIZE |
schedule_delay_millis | int | 5000 | TRACCIA_SCHEDULE_DELAY_MILLIS |
Note: Rate limiting is disabled by default (max_spans_per_second = None). Set a value to enable it.
[runtime]
| Option | Type | Default | Environment Variables |
|---|---|---|---|
session_id | string? | None | TRACCIA_SESSION_ID |
user_id | string? | None | TRACCIA_USER_ID |
tenant_id | string? | None | TRACCIA_TENANT_ID |
project_id | string? | None | TRACCIA_PROJECT_ID |
agent_id | string? | None | TRACCIA_AGENT_ID, AGENT_DASHBOARD_AGENT_ID |
agent_name | string? | None | TRACCIA_AGENT_NAME |
env | string? | None | TRACCIA_ENV |
TRACCIA_PROJECT is also supported as a legacy alias for project_id.
[logging]
| Option | Type | Default | Environment Variables |
|---|---|---|---|
debug | bool | false | TRACCIA_DEBUG |
enable_span_logging | bool | false | TRACCIA_ENABLE_SPAN_LOGGING |
[advanced]
| Option | Type | Default | Environment Variables |
|---|---|---|---|
attr_truncation_limit | int? | None | TRACCIA_ATTR_TRUNCATION_LIMIT |
Special Environment Variables
AGENT_DASHBOARD_PRICING_JSONCustom pricing table as JSON string. Overrides default model pricing.
export AGENT_DASHBOARD_PRICING_JSON='{ "gpt-4": {"input": 0.03, "output": 0.06}, "gpt-3.5-turbo": {"input": 0.001, "output": 0.002}}'AGENT_DASHBOARD_AGENT_CONFIGPath to agent_config.json file for agent metadata enrichment.
export AGENT_DASHBOARD_AGENT_CONFIG="/path/to/agent_config.json"OTEL_SERVICE_NAMEStandard OpenTelemetry service name (also supported: SERVICE_NAME).
export OTEL_SERVICE_NAME="my-agent-service"Example Configurations
Development (Console Output)
[tracing]use_otlp = false
[exporters]enable_console = true
[logging]debug = trueenable_span_logging = falseLocal Jaeger/Tempo
[tracing]endpoint = "http://localhost:4318/v1/traces"use_otlp = trueservice_name = "my-agent"sample_rate = 1.0
[instrumentation]enable_patching = trueenable_token_counting = trueenable_costs = trueProduction (Traccia Platform)
[tracing]api_key = "tr_live_xxxxxxxxxxxx"endpoint = "https://api.traccia.ai/v2/traces"sample_rate = 0.1service_name = "production-agent"
[rate_limiting]max_spans_per_second = 100.0max_queue_size = 5000
[runtime]agent_id = "my-agent"agent_name = "My Agent"env = "production"tenant_id = "acme-corp"project_id = "customer-service"
[logging]debug = falseMulti-Agent Orchestrator
For a service that hosts many logical agents, use service_role programmatically and scope per-run identity with runtime_config.run_identity():
from traccia import init, runtime_config
init( api_key="tr_live_xxxxxxxxxxxx", service_name="my-orchestrator-api", service_role="orchestrator", # prevents this service being registered as an agent auto_start_trace=False,)
with runtime_config.run_identity(agent_id="billing-agent", agent_name="Billing Agent", env="production"): # all traces/metrics in this block are attributed to billing-agent ...Governance
Passed to init() / start_tracing(). See Python SDK API (Governance section).
| Option | Type | Default | Environment |
|---|---|---|---|
compliance | dict | None | TRACCIA_COMPLIANCE_FRAMEWORKS (comma-separated) |
redact_pii | bool | false | TRACCIA_REDACT_PII |
compliance example: {"frameworks": ["eu_ai_act"], "risk_tier": "high"}. Human review is not an SDK option — use the Governance Hub.
Advanced — runtime policy URLs
Optional [governance] in traccia.toml. Not required for normal use — status and block URLs are derived from your tracing endpoint. See Governance guide.
[governance]# Advanced only — omit for standard Traccia deploymentsstatus_check_endpoint = "https://custom.example/agents/{agent_id}/status"post_block_endpoint = "https://custom.example/agents/{agent_id}/blocks"status_cache_ttl_seconds = 120Next Steps
© 2026 Traccia.