Implementation:Confident ai Deepeval TraceManager Configure
Overview
TraceManager Configure is the implementation method that configures the global trace collection behavior in DeepEval. Through the trace_manager.configure() method on the singleton TraceManager instance, developers control sampling rates, data masking functions, environment labels, client integrations, and the global tracing toggle.
API Documentation
Method: trace_manager.configure
Source: deepeval/tracing/tracing.py:L151-178
Import:
from deepeval.tracing import trace_manager
Singleton: trace_manager is a global TraceManager instance defined at deepeval/tracing/tracing.py:L806.
Signature:
trace_manager.configure(
mask=None,
environment=None,
sampling_rate=None,
confident_api_key=None,
anthropic_client=None,
openai_client=None,
tracing_enabled=None,
) -> None
Parameters
| Parameter | Type | Description |
|---|---|---|
mask |
Optional[Callable] |
A PII redaction function applied to trace data before transmission. Receives data as input and returns the masked version. |
environment |
Optional[str] |
Environment label for trace segregation (e.g., "production", "staging", "development").
|
sampling_rate |
Optional[float] |
A value between 0.0 and 1.0 controlling the fraction of traces collected. 0.1 means 10% of traces are collected.
|
confident_api_key |
Optional[str] |
Override the default Confident AI API key for trace submission. |
anthropic_client |
Optional |
An Anthropic client instance for automatic instrumentation of Anthropic API calls. |
openai_client |
Optional |
An OpenAI client instance for automatic instrumentation of OpenAI API calls. |
tracing_enabled |
Optional[bool] |
Global toggle to enable or disable all tracing. When False, no traces are collected or transmitted.
|
Input / Output
- Inputs: Configuration parameters controlling trace collection behavior.
- Outputs: The global
TraceManagersingleton is configured, and all subsequent trace operations respect the new settings. ReturnsNone.
Usage Example
from deepeval.tracing import trace_manager
def mask_pii(data):
return data.replace("@", "[REDACTED]")
trace_manager.configure(
environment="production",
sampling_rate=0.1,
mask=mask_pii,
tracing_enabled=True,
)
Relationships
Principle:Confident_ai_Deepeval_Trace_Configuration
Related Pages
- Environment:Confident_ai_Deepeval_Python_3_9_Runtime
- Environment:Confident_ai_Deepeval_LLM_Provider_Credentials
Metadata
DeepEval Tracing Observability LLM_Evaluation 2026-02-14 09:00 GMT