Configure the ZeroEval tracer through environment variables, initialization parameters, or runtime methods.

Environment Variables

Set before importing ZeroEval to configure default behavior.
VariableTypeDefaultDescription
ZEROEVAL_API_KEYstring""API key for authentication
ZEROEVAL_API_URLstring"https://api.zeroeval.com"API endpoint URL
ZEROEVAL_WORKSPACE_NAMEstring"Personal Workspace"Workspace name
ZEROEVAL_SESSION_IDstringauto-generatedSession ID for grouping traces
ZEROEVAL_SESSION_NAMEstring""Human-readable session name
ZEROEVAL_SAMPLING_RATEfloat"1.0"Sampling rate (0.0-1.0)
ZEROEVAL_DISABLED_INTEGRATIONSstring""Comma-separated integrations to disable
ZEROEVAL_DEBUGboolean"false"Enable debug logging
Activation: Set environment variables before importing the SDK.
export ZEROEVAL_API_KEY="ze_1234567890abcdef"
export ZEROEVAL_SAMPLING_RATE="0.1"
export ZEROEVAL_DEBUG="true"

Initialization Parameters

Configure via ze.init() - overrides environment variables.
ParameterTypeDefaultDescription
api_keystringNoneAPI key for authentication
workspace_namestring"Personal Workspace"Workspace name
debugbooleanFalseEnable debug logging with colors
api_urlstring"https://api.zeroeval.com"API endpoint URL
disabled_integrationslist[str]NoneIntegrations to disable
enabled_integrationslist[str]NoneOnly enable these integrations
setup_otlpbooleanTrueSetup OpenTelemetry OTLP export
service_namestring"zeroeval-app"OTLP service name
tagsdict[str, str]NoneGlobal tags for all spans
sampling_ratefloatNoneSampling rate (0.0-1.0)
Activation: Pass parameters to ze.init().
ze.init(
    api_key="ze_1234567890abcdef",
    sampling_rate=0.1,
    disabled_integrations=["langchain"],
    debug=True
)

Runtime Configuration

Configure after initialization via ze.tracer.configure().
ParameterTypeDefaultDescription
flush_intervalfloat1.0Flush frequency in seconds
max_spansint20Buffer size before forced flush
collect_code_detailsbooleanTrueCapture code details in spans
integrationsdict[str, bool]{}Enable/disable specific integrations
sampling_ratefloatNoneSampling rate (0.0-1.0)
Activation: Call ze.tracer.configure() anytime after initialization.
ze.tracer.configure(
    flush_interval=0.5,
    max_spans=100,
    sampling_rate=0.05,
    integrations={"openai": True, "langchain": False}
)

Available Integrations

IntegrationUser-Friendly NameAuto-Instruments
OpenAIIntegration"openai"OpenAI client calls
GeminiIntegration"gemini"Google Gemini calls
LangChainIntegration"langchain"LangChain components
LangGraphIntegration"langgraph"LangGraph workflows
HttpxIntegration"httpx"HTTPX requests
VocodeIntegration"vocode"Vocode voice SDK
Control via:
  • Environment: ZEROEVAL_DISABLED_INTEGRATIONS="langchain,langgraph"
  • Init: disabled_integrations=["langchain"] or enabled_integrations=["openai"]
  • Runtime: ze.tracer.configure(integrations={"langchain": False})

Configuration Examples

Production Setup

# High-volume production with sampling
ze.init(
    api_key="your_key",
    sampling_rate=0.05,  # 5% sampling
    debug=False,
    disabled_integrations=["langchain"]
)

ze.tracer.configure(
    flush_interval=0.5,   # Faster flushes
    max_spans=100         # Larger buffer
)

Development Setup

# Full tracing with debug info
ze.init(
    api_key="your_key",
    debug=True,           # Colored logs
    sampling_rate=1.0     # Capture everything
)

Memory-Optimized Setup

# Minimize memory usage
ze.tracer.configure(
    max_spans=5,                    # Small buffer
    collect_code_details=False,     # No code capture
    flush_interval=2.0              # Less frequent flushes
)