How OpenTelemetry tracing for NeMo Guardrails shows what each request did
When a team running NeMo Guardrails in production cannot explain why a request was blocked, slowed down or rerouted, the logs of the application usually show only the final answer. Tracing gives per-request visibility into each rail and each LLM call, so the team can see the sequence of checks, the time each one took and the point where the outcome changed. OpenTelemetry provides the standard way to generate and export that telemetry, but it is not an observability backend. It does not store, search or draw traces on its own, so the team must also choose where traces go and who can open them.
Teams need traces once more than one rail or model call sits behind a single user request, or once latency complaints or unexplained blocks start arriving from users and support staff. Traces are also the usual starting point for a security review of guardrail behavior, because they connect an input, the rails it passed through and the response it produced. Before enabling anything, confirm which NeMo Guardrails version and Python release your environment runs, since the current 0.25.0 release requires Python 3.11, 3.12 or 3.13, and confirm how the trace data will be handled, because prompt and response content may appear in spans.
This page follows the work in order: the OpenTelemetry adapter and SDK configuration, the GenAI span conventions, which rails and LLM calls appear in traces, and sending traces to Jaeger or a commercial backend. The OpenTelemetry documentation is the natural next read for the vendor-neutral concepts. Capturing content and debugging blocked requests are covered on sibling pages, so this page keeps to the mechanics of getting spans out of the application and into a backend you control.
How a guarded request flows from application to trace backend
The request starts in the application, which calls NeMo Guardrails through the Python API or the guardrails server. Each rail and LLM call the guardrails run emits spans through the OpenTelemetry SDK inside the application network. The trust boundary sits where spans leave that network for the Collector, so check what the exporter sends across it. Collector placement (agent or gateway) and the backend you choose, such as Jaeger or a commercial service, determine who can read the trace data.
Spans cross the trust boundary between the application network and the trace backend.
Choosing between the Python API and the guardrails server for tracing
Embedding the library places the OpenTelemetry SDK in the same process as your application, and the rails run inside that process. Guardrail spans therefore sit alongside your application's own spans, and you configure telemetry once in the application's startup code. Confirm in the NeMo Guardrails documentation how the adapter is enabled and whether it reads standard OpenTelemetry SDK settings or its own configuration keys.
- Initialization order: Set up the tracer provider and exporter before you create the rails object, so the first guardrail call is recorded.
- Environment variables: Set exporter endpoints and the service name in the process environment through your deployment spec, not in application source.
- Service identity: Guardrail spans carry your application's service name, so a separate guardrails service name only appears if you define one.
- Multiple workers: Each worker process runs its own SDK instance and exporter, so confirm every worker exports before you rely on a dashboard.
- Version changes: NeMo Guardrails 0.25.0 deprecates
LLMRailsin favor ofGuardrails, so check initialization calls against the migration guide.
Test with a single request in a non-production environment and confirm the spans arrive before you roll out the change.
Running the guardrails server separates guardrail processing from the calling applications, so one telemetry setup covers every client that uses it. The server loads configurations from a folder and exposes an HTTP API, so calling applications do not import the library. Traces from the server describe guardrail work for all callers, which makes service names, resource attributes and propagated trace context the main ways to tell applications apart.
- Configuration folder: The server reads its configurations from a folder, so keep telemetry settings in the deployment definition next to it and confirm which file or variables the server reads.
- Context propagation: Confirm whether the server accepts incoming trace context headers, so guardrail spans attach to the caller's trace instead of starting a new one.
- Runtime settings: Pass exporter endpoints and credentials to the server container at runtime, not baked into the image.
- Exporter path: Point the server at a local OpenTelemetry Collector or directly at a backend. The Collector gives you one place to change backends later.
- Shutdown behavior: Spans in flight during a restart can be lost unless the exporter flushes on shutdown, so test a rolling restart before production.
Confirm that the server version you run exposes the tracing options your design depends on before you build dashboards.
The Dockerfile in the NeMo Guardrails repository builds a server image from the library, so telemetry packages must be present in that image or added in a derived image. Your base image and Python version limit what you can install. NeMo Guardrails 0.25.0 requires Python 3.11, 3.12 or 3.13. Do not base new tracing work on the NGC microservice container, because NVIDIA has sunset the NeMo microservices and no longer supports that artifact.
- Python version: Build on Python 3.11, 3.12 or 3.13 so the library and telemetry packages install together.
- Derived image: Add the OpenTelemetry packages your setup needs in a derived Dockerfile and pin their versions in your build.
- Configuration injection: Mount configuration folders and secrets at runtime so one image serves every environment.
- Legacy container: Existing deployments on the sunset NGC container need a migration plan first, and new trace configuration should not be built on that image.
- Rebuild cadence: Rebuild and rescan the image when you adopt a new library release, such as 0.25.0 published on 19 November 2026.
Before you standardize on an image, confirm the packages and settings it includes against the current documentation.
Tracing configuration options and when each fits
This table compares the main ways to get NeMo Guardrails spans to a trace backend: direct SDK export, a Collector agent, a Collector gateway, a self-hosted Jaeger backend and a commercial OTLP backend, along with sampling. Read each row as a trade-off between operational load and control over data handling. The main takeaway is that the Collector adds a component to run but gives a single place to redact, sample and route content before it leaves your network.
| Option | When it fits | Operational cost | What to confirm |
|---|---|---|---|
| Direct export from the application SDK | A single guardrails service in one environment with one trace backend and no redaction needs | Lowest component count, but every service needs backend endpoint and credential settings and retry tuning | Whether your NeMo Guardrails runtime and OTLP exporter versions support the span attributes you plan to rely on |
| Collector agent beside the service | Services that need local buffering and a consistent exporter config across many hosts or pods | One extra process per host or pod to deploy, patch and monitor | Collector version and its stability level for each component you enable, per the component README |
| Collector gateway shared by services | Several guardrails deployments or AI applications sending to one or more backends, with central sampling and filtering | A stateful tier to size, scale and secure; a misconfigured gateway affects every sender | Authentication options for incoming and outgoing connections, such as OIDC on receivers or oauth2client on exporters |
| Self-hosted Jaeger backend | Teams that want trace storage and the UI inside infrastructure they control and have an ops owner for it | You run storage, retention, upgrades and access control for the trace data | Storage backend choice, retention period and who can query spans that contain request content |
| Commercial OTLP-compatible backend | Teams that prefer a managed service and accept data leaving their network under a contract that covers it | Recurring vendor fees and data-residency review; less storage operations work | Data region, retention, encryption, sub-processors and whether the vendor's ingestion accepts your span attributes unchanged |
| Head-based sampling in the SDK | Low volume environments or when every guardrail decision must be recorded | Simple to configure; dropped traces cannot be recovered later | Whether blocked-request traces are kept at the rate you need for incident review |
| Tail-based sampling in the Collector | High volume deployments where keeping traces with blocks or errors matters more than volume | Requires a Collector tier with enough memory to hold traces until they complete | Which Collector components provide tail sampling in your distribution and their stability level |
Setting up tracing from SDK to backend
This sequence takes a NeMo Guardrails 0.25.0 application from a bare Python environment to traces of guarded requests in a backend. Each step ends with a check, so the platform or security team can confirm that input rails, output rails and LLM calls are recorded before anyone relies on the data.
Confirm Python and the guardrails version
The application engineer confirms the runtime is Python 3.11, 3.12 or 3.13 and installs nemoguardrails 0.25.0 from PyPI in a clean virtual environment. Run the Python version command and the package metadata command against the environment that will serve traffic. The step is done when both report the supported Python version and the 0.25.0 release, and a minimal guardrails configuration loads without errors.
Install the OpenTelemetry SDK and exporter
The same engineer adds the OpenTelemetry Python SDK and an OTLP exporter to the environment, pinning versions in the project lock file so tracing does not change silently between builds. Trace APIs and SDKs are stable for Python, so the team can plan around them. The step is done when the packages appear in the environment listing and a small test script can create and export one span to the console without errors.
Configure the tracing adapter
Enable the NeMo Guardrails tracing adapter in the configuration files and set the exporter endpoint through the standard OpenTelemetry environment variables. Confirm the exact configuration keys and the list of spans the adapter emits in the NeMo Guardrails documentation for your release, since the keys belong to the library, not to this sequence. The step is done when application startup logs show the adapter initialized and no exporter errors appear.
Run a Collector with an OTLP pipeline
The platform engineer runs an OpenTelemetry Collector that receives OTLP from the application, batches the data and exports traces to the chosen backend. Use a distribution from the releases page, such as the contrib build from a recent release like v0.163.0, and check its signed artifacts and checksums before deployment. The Collector configuration reference defines the receiver, processor and exporter blocks. The step is done when the Collector logs show the OTLP receiver listening and the exporter starts without errors.
Connect Jaeger or a commercial backend
Point the Collector exporter at Jaeger or at a commercial backend that accepts OTLP, and confirm that the backend version in your environment supports the protocol and the ingestion endpoint you configured. Ask the commercial vendor to confirm its OTLP intake details and any authentication it requires, since those settings sit outside this sequence. The step is done when the backend's service list shows the application's service name, even if no guarded request has been sent yet.
Send test guarded requests
The application engineer sends two requests through the guarded application: one benign prompt that should pass every rail, and one prompt built to trigger a configured input rail, such as a blocked topic. Use the Python API or the guardrails server, whichever is in production. The step is done when both requests return the expected responses and at least one new trace for each request appears in the backend within the Collector's batch window.
Verify rails and LLM calls in traces
Open the traces and check each one against the active configuration. The input rail span should appear for both requests, the output rail span should appear for the benign request, and the LLM call span should appear with the model name for the request that reached the model. The blocked request should show where it stopped. If a expected span is missing, check the adapter settings and the rail configuration before changing the Collector. The step is done when the team can explain every span in both traces.
Protecting trace data and the telemetry pipeline
Traces from a guardrailed LLM application can carry the most sensitive data in your stack: user prompts, model responses and retrieved content. The cards below cover where that data can leak, how to keep the Collector pipeline closed to unauthorized senders and readers, and which configuration checks to make before traces leave your network.
Prompts and responses in spans
Span attributes and events can hold the text of user inputs, model outputs and retrieved chunks, which is the content a guardrail is meant to inspect. Content capture should be a deliberate choice rather than a default, and the detail for turning it on, and which spans record content, is covered in the separate content capture topic. Before go-live, run a test request through the full rail chain and read the exported spans to confirm what text actually appears.
Collector configurationPII in attributes
Even with content capture off, identifiers such as user IDs, email addresses, session tokens or account numbers can end up in custom attributes added by your own actions or middleware. Review every custom attribute name and value your code sets on guardrail spans. Hash or drop identifiers that are not needed for debugging, and agree the attribute list with your privacy team.
Unauthenticated Collector receivers
A Collector receiver that accepts OTLP without authentication lets any host on the network send data into your pipeline, which can poison traces or flood storage. Restrict receiver endpoints to the networks that need them and place the Collector behind your existing network controls. Where your clients can carry identity, use an authenticator extension on the receiver so each incoming connection is checked.
OIDC on receivers and oauth2client on exporters
Collector authenticator extensions do two jobs. The OIDC option checks identity on incoming connections to a receiver, and the oauth2client option adds credentials to requests the exporter sends to a backend. Confirm with your identity team which provider issues the tokens, how they are rotated, and whether the exporter's credentials are scoped only to write traces. Check each extension's README for its current stability level before you rely on it.
Collector configurationOver-broad backend access
Trace backends often let many engineers and tools query every span, including ones with sensitive attributes. Decide who may read guardrail traces, separate write credentials from read credentials, and limit retention to what incident review requires. Ask the backend vendor or project to show how role-based access, audit logs and retention policies are configured, because these features differ between products.
Configuration best practices review
The OpenTelemetry project publishes configuration best practices for the Collector, covering areas such as securing receivers, limiting exposed endpoints and handling credentials. Use that page as a checklist when you write the Collector configuration for guardrail traces, and record which items you accepted, changed or deferred. Repeat the review whenever you upgrade the Collector, since new releases can change defaults.
Configuration best practicesQuestions teams ask before tracing NeMo Guardrails
How much does it cost to add OpenTelemetry tracing to NeMo Guardrails?
No public price applies to this work, and DeployOpen does not publish a price list, so the cost comes from a written scope. Most of the spend is labor: configuring the adapter and SDK, deciding which rails and LLM calls to trace, wiring the exporter, and reviewing what content lands in spans. Recurring costs sit with your infrastructure, meaning the Collector, the trace backend's storage and retention, and the people who watch dashboards. Ask any quote to separate one-time build work from ongoing support, and to name the backend and Collector topology it assumes.
How long does OpenTelemetry tracing for NeMo Guardrails take to set up?
The duration depends on scope, and no timeline applies to this topic from the sources available here. The main drivers are how many rails your configuration defines, how many distinct LLM and action calls you need to see, whether you run the guardrails server or the Python API, and whether a Jaeger instance or a commercial backend already exists. A small single-configuration setup moves faster than a multi-team deployment with several environments, retention rules and privacy review. Ask for milestones in the written scope rather than a single end date.
What does my team need to provide for a tracing engagement?
You need to provide access to the environment where NeMo Guardrails runs, the configuration folder with config.yml, any Python actions and Colang files, and the Python version in use. NeMo Guardrails 0.25.0 requires Python 3.11, 3.12 or 3.13, so confirm your runtime early. You also need the trace backend choice, a named owner for the Collector, and a decision on whether prompts and responses may appear in spans. Your security team should be available to review the privacy implications before anything is exported.
Can our own engineers set up NeMo Guardrails tracing without a partner?
Yes, a team with Python and Collector experience can do this in-house, and the official documentation covers the adapter and SDK setup. The work is manageable for one configuration in a test environment. It becomes harder when you need consistent span naming across services, a Collector gateway with authentication, retention tied to a privacy policy, and checks that blocked requests show the right rail. Decide early which of these you will own, and whether a partner will hand over runbooks and configuration files you can maintain.
Does tracing change if we move to NeMo Helix?
Yes, the setup changes, and you should confirm the details before you plan. NVIDIA's NeMo Microservices documentation says the microservice is sunset and that new development has moved to NeMo Platform. The NeMo Platform repository now points to NVIDIA-NeMo/nemo-helix, an Apache-2.0 control plane that runs NeMo Guardrails as an inference gateway middleware plugin for model endpoints. Traces from a gateway plugin may cross a different process boundary than a standalone guardrails server, so the spans, service names and where the exporter runs all need to be checked on that platform. Read the NeMo Helix guardrail documentation and confirm with NVIDIA how instrumentation is supported before you commit.
What drives the Collector topology and backend cost?
Collector topology and backend choice shape both the build effort and the running cost. The OpenTelemetry Collector can run as an agent beside each service or as a gateway that accepts data from many sources, and the choice affects how much processing happens close to your workloads. Jaeger and commercial backends differ in licensing, storage pricing and operational load, so compare them against your retention needs. Ask for the expected trace volume, the sampling approach and the retention period in writing, since these drive storage cost more than the initial install.
Which privacy and security checks apply before sending traces anywhere?
Check what each span records before any trace leaves your network, because guardrail traces can carry user input, model output and retrieved content that may hold personal data. Plan a review of content capture settings, retention and who can query the backend. If you route through a Collector gateway, use its authenticator extensions to authenticate incoming connections and outgoing exporter requests, for example with OIDC or the oauth2client extension. Document the decisions so your compliance team can review them. DeployOpen can prepare that evidence, but it does not issue audit reports or certifications.
How DeployOpen scopes and delivers NeMo Guardrails tracing
Tracing work for NeMo Guardrails is scoped in writing before any configuration starts. DeployOpen agrees the scope, deliverables and timeline with you in a written document, and that document is the basis for the quote. For this topic, the scope should name the components in play: the NeMo Guardrails version and Python runtime, whether the guardrails run through the Python API or the guardrails server, the OpenTelemetry SDK or adapter settings, the OpenTelemetry Collector topology, and the tracing backend you will use, such as Jaeger or a commercial service. It should also state which rails and LLM calls must appear in traces, and whether content capture is in or out of scope, since that decision changes the privacy review.
The work runs in your infrastructure. Collectors, the tracing backend, storage, network routes and any credentials for the backend stay under your cloud accounts, data centers or air-gapped networks. Before the engagement starts, confirm who owns each of those systems, who can approve changes to exporter endpoints and authentication, and where trace data may be stored. Ask for the written scope to list those owners, so that the handover includes the runbooks your own team will need after the work ends.
Costs are one-time and recurring, and the quote shows which is which. The one-time part covers scoping, instrumentation, Collector pipeline setup, verification and handover. Recurring costs come from upgrades to NeMo Guardrails and OpenTelemetry components, and from continuous checks on trace content. DeployOpen offers optional retainers for upgrades and continuous testing. DeployOpen does not publish a price list, so a quote follows from the written scope. Ask for the quote to separate fixed deliverables from retainer items, and to name what changes the price, such as the number of configurations, the number of backends or a decision to add content capture.

