nemo_gym.orchestration.executors.otel
nemo_gym.orchestration.executors.otel
The OpenTelemetry collector that runs beside every benchmark job.
One collector per benchmark job, in its own srun --overlap step like any other service. It
scrapes each model service’s Prometheus /metrics on localhost, accepts OTLP from the job’s own
processes, stamps the resource attributes the shared dashboards filter on (user, run_id,
slurm_job_id, plus benchmark, cluster, model), and exports to the configured OTLP/HTTP
endpoint (when remote export is enabled) and to <job dir>/otel/*.jsonl (written node-local, copied when it stops).
The local metrics.jsonl is a lighter copy than the remote export, because node_exporter’s full output made up about
90% of its bytes (several GiB per run) and is node health rather than benchmark performance:
- node_exporter metrics outside
otel.local_node_metrics(CPU time, load, memory, pressure stall, network and InfiniBand byte totals by default) are dropped from it.local_node_metrics: nullkeeps all of them, andlocal_node_metrics_extraadds patterns; - the
span_metricsconnector feeds only the remote export, since the same call counts and durations come from the spans intraces.jsonl. The remote export is unchanged.
The ingest token travels twice, as the HTTP Authorization header and as an Authorization
resource attribute: a routing proxy in front of the backend resolves the tenant from the
attribute and silently drops payloads without it while still answering 200.
Module Contents
Functions
Data
API
The filter processor that drops node_exporter metrics outside otel.local_node_metrics from the local file.
Keyed on the scrape job rather than a name prefix, so it covers every family node_exporter serves (including textfile collectors with their own prefixes) on every scraped node, and leaves DCGM, engine and Gym metrics alone.
value as an OTTL string literal inside the collector’s YAML: $$ stops the collector’s own ${...} expansion.
Environment that switches on Gym’s Lens instrumentation and points it at the collector.
Gym reads these in every server process (NEMO_GYM_OTEL_* are Gym’s own, the OTEL_* ones
are the SDK’s); an explicit value in driver.env wins over these.
Whether the driver is instrumented with nemo-lens and pointed at the collector.
Enabled is enough: Gym’s own servers push telemetry even when there is no local model to scrape.
The collector’s YAML for one benchmark job.
run_id is the submission’s gym job id, which is the job directory’s parent by construction
(<output_path>/<gym_job_id>/<benchmark>); cluster is the sole compute key, the same value
SubmissionRecord.cluster records. Values only known inside the job (SLURM_JOB_ID, the
token, the node-local directory) are left as ${env:...} for the collector to expand at startup.
node_local=False writes the jsonl straight into the job directory, for a job.sh that predates the copy.
Resolve the remote ingest token, switching to local collection with a warning if absent.
Service name to serving port for every service that exposes a model (and so /metrics).
Remote export needs a destination; local collection does not.
Environment for a traced vLLM service.
vLLM picks the exporter by OTEL_EXPORTER_OTLP_TRACES_PROTOCOL and defaults to gRPC, so the
protocol has to match the HTTP endpoint in the flag. vLLM sets no service.name of its own; the
collector copies the one given here into service.name.override, so the spans carry the same
display identity as the service’s scraped metrics (<component>/<service>).
The vllm serve flag that sends one span per request to the collector’s OTLP/HTTP receiver.