Observability
NeMo Gym can emit OpenTelemetry traces, metrics, and logs through nemo-lens, the shared instrumentation library for the NVIDIA NeMo ecosystem. Telemetry is optional and off by default.
Why This Exists
A single rollout crosses several NeMo Gym processes. The agent server calls the model server, and both call the resources server. Each is a separate FastAPI process with its own logs, so answering “where did this rollout spend its time?” has meant reading three log files side by side and matching timestamps.
With telemetry enabled, one rollout produces one distributed trace. Every hop appears as a nested span with the correct parent, so the timeline reads top to bottom:
This is application telemetry: where time goes, what failed, and how a configuration behaves on hardware you do not control. It does not replace Weights & Biases or MLflow, which track experiment telemetry such as reward and accuracy. The two answer different questions, and NeMo Gym keeps them separate. See Metrics.
Quick Start
Install the extra and turn telemetry on:
Every server process now writes one JSON object per line to its stdout. To read the trace,
collect the output and group it by trace_id:
To send telemetry to a collector instead, set an OTLP endpoint:
What You Get
Cost When Disabled
Telemetry is off unless you enable it, and a disabled instrumentation site costs a single frozenset membership test. NeMo Gym runs at 16k+ concurrency, so every instrumentation site checks whether its span group is enabled before it does anything else, including building attributes and importing modules.
If nemo-lens is not installed at all, NeMo Gym imports and runs exactly as it does
without this feature. There is no import error and no missing attribute.
Next Steps
The telemetry: config block, environment variables, and exporters.
How one rollout becomes one trace across several server processes.
Control which spans exist, and how much a trace costs.
Which metrics NeMo Gym emits, and which it deliberately does not.
Add spans to your own resources server, agent, or model server.