Tracing Configuration for the NVIDIA NeMo Guardrails Library
This section describes how to configure tracing and monitoring in the config.yml file.
Overview
The NeMo Guardrails library includes tracing capabilities to monitor and debug guardrails interactions. Tracing helps you understand rail activation, LLM call patterns, flow execution, and error conditions.
The tracing Key
Configure tracing in config.yml:
Configuration Options
Content Capture
By default, traces record metadata about each request but not the prompt or response content.
Set enable_content_capture: true to additionally record message content on spans:
Content capture records user inputs and model outputs, which can include sensitive information (PII). The behavior, environment variable overrides, and output format differ between the IORails and LLMRails engines. See Content Capture for the full contract.
Tracing Adapters
FileSystem Adapter
Log traces to local JSON files (recommended for development):
OpenTelemetry Adapter
Integrate with observability platforms (recommended for production):
To use OpenTelemetry tracing, install the tracing dependencies:
pip install nemoguardrails[tracing]
OpenTelemetry integration requires configuring the OpenTelemetry SDK in your application code. The NeMo Guardrails library follows OpenTelemetry best practices where libraries use only the API and applications configure the SDK.
Adapter Comparison
Multiple Adapters
Configure multiple adapters simultaneously:
Trace Information
Traces capture the following information:
Example Configurations
Development Configuration
Production Configuration
Comprehensive Configuration
OpenTelemetry Setup
To use OpenTelemetry in production, configure the SDK in your application:
Viewing Traces
FileSystem Traces
View JSON traces from the filesystem:
OpenTelemetry Traces
View traces in your configured observability platform:
- Jaeger
- Zipkin
- Grafana Tempo
- Datadog
- New Relic
Related Topics
- Tracing Guide - Detailed tracing setup and examples
- Detailed Logging - Additional logging options