> This page is for version 0.12.
> For other versions, use one of these documentation indexes:
> - Latest (default): https://docs.nvidia.com/nemo-helix/latest/llms.txt
> - 0.12: https://docs.nvidia.com/nemo-helix/v0.12/llms.txt
> - 0.11: https://docs.nvidia.com/nemo-helix/v0.11/llms.txt
> - 0.10: https://docs.nvidia.com/nemo-helix/v0.10/llms.txt
> - 0.9: https://docs.nvidia.com/nemo-helix/v0.9/llms.txt
> - 0.8: https://docs.nvidia.com/nemo-helix/v0.8/llms.txt
> - 0.7: https://docs.nvidia.com/nemo-helix/v0.7/llms.txt
> - 0.6: https://docs.nvidia.com/nemo-helix/v0.6/llms.txt
> - 0.5: https://docs.nvidia.com/nemo-helix/v0.5/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/nemo-helix/llms.txt.

# OpenTelemetry Setup

## Configuration

NeMo Helix uses standard [OpenTelemetry SDK settings](https://opentelemetry.io/docs/languages/sdk-configuration/)
to configure export of traces, metrics, and Python application logs.

## Internal Job Metrics

The jobs service records operational metrics before checking whether an anonymous
usage event can be sent. Recording covers jobs with or without a telemetry session
and remains active when `NEMO_TELEMETRY_ENABLED=false`. These metrics use only the
platform's existing OpenTelemetry MeterProvider and operator-configured exporters;
no NVIDIA usage-telemetry destination or additional exporter is configured by this
instrumentation. `OTEL_METRICS_EXPORTER=none` still disables metric export.

| OTel instrument                   | Prometheus name                 | Meaning                                                                                            |
| --------------------------------- | ------------------------------- | -------------------------------------------------------------------------------------------------- |
| `nhx.jobs.run.events.total`       | `nhx_jobs_run_events_total`     | Accepted attempt transitions into `completed`, `error`, `cancelled`, or `paused`.                  |
| `nhx.jobs.run.duration` (seconds) | `nhx_jobs_run_duration_seconds` | Final attempt wall-clock duration, including queue/pause time; histogram, not active compute time. |
| `nhx.jobs.run.tokens.total`       | `nhx_jobs_run_tokens_total`     | Known terminal job-summary token counts, split by `direction=input` or `output`.                   |

Attributes are bounded `job_type`, `tool_category`, and `status`, plus `direction`
for tokens. There are no session/event/attempt IDs, job/workspace/model names, or
arbitrary plugin labels. Unrecognized sources use safe category buckets. A pause
increments the lifecycle counter but does not record a partial duration or token
summary, avoiding overlap with a later final observation. Missing measurements
are skipped, not treated as zero; a measured zero remains valid.

The dispatcher records after a successful state change, not during anonymous
telemetry delivery or its retries. Replayed same-state updates do not increment
the metrics again. Metric failures do not block job transitions or optional usage
telemetry, and usage-telemetry failures do not undo internal measurements. These
are process-local operational metrics, not a durable audit or billing ledger;
process failures can lose measurements, and counters reset on restart.

To count finished attempts, filter the event counter to `completed`, `error`, and
`cancelled` (exclude `paused`). Token summaries remain partial job-level reports;
do not add them to inference-level token counters for the same work. The existing
anonymous-telemetry opt-in/session requirements and delivery frequency are unchanged.

## Helm Configuration

For Helm deployments, set OpenTelemetry environment variables under `telemetry`
in your chart values. This example exports traces and metrics over gRPC.
Replace the example address with the endpoint of your collector.

```yaml
telemetry:
  OTEL_TRACES_EXPORTER: "otlp"
  OTEL_METRICS_EXPORTER: "otlp"
  OTEL_EXPORTER_OTLP_ENDPOINT: "otel-collector.example.com:4317"
  OTEL_EXPORTER_OTLP_INSECURE: true
```

See the [Helm reference](/nemo-helix/v0.12/documentation/kubernetes-deployment/helm/helm-reference) for chart defaults.

## Python application logs

Helix can send Python log records directly to an OpenTelemetry Collector while
keeping console logging active. The API, controllers, and managed Python tasks
use the standard OpenTelemetry logging handler.

```bash
export OTEL_PYTHON_LOG_AUTO_INSTRUMENTATION=true
export OTEL_LOGS_EXPORTER=otlp
export OTEL_EXPORTER_OTLP_LOGS_ENDPOINT=http://otel-collector.example.com:4318/v1/logs
export OTEL_EXPORTER_OTLP_LOGS_PROTOCOL=http/protobuf
```

Replace the example endpoint with one reachable from the emitting process.
The collector needs an OTLP receiver for the selected protocol and a logs
pipeline. For the API and controllers, you can also set these variables under
`telemetry` in your Helm values. Managed job pods use their own environment.

`OTEL_PYTHON_LOG_AUTO_INSTRUMENTATION` defaults to `true` when unset. Set it to
`false` to skip installing the OpenTelemetry logging handler.
`OTEL_LOGS_EXPORTER=none` (the default) disables direct OTLP log export even when
the handler is installed. `OTEL_SDK_DISABLED=true` also disables direct export.
Console logging continues with the configured `LOG_FORMAT`, `LOG_LEVEL`, and
sensitive-data filtering.

Log-specific `OTEL_EXPORTER_OTLP_LOGS_ENDPOINT` and
`OTEL_EXPORTER_OTLP_LOGS_PROTOCOL` override the general endpoint and protocol.
Supported protocols are `grpc` (the default) and `http/protobuf`. For HTTP, Helix
appends `/v1/logs` to the general endpoint. Include the full logs path when
setting a log-specific endpoint. Standard OTLP exporter settings for headers,
timeouts, TLS, and insecure transport also apply.

Direct records retain severity, exception details, available trace/span IDs,
service/workspace/job context, and extra structured fields. Source-file metadata
and traceback frames report filenames only.

Messages marked with `extra={"sensitive": True}` are discarded from both console
and direct OTLP output. This filter does not automatically redact secrets or
personal data from unmarked messages, exceptions, or extra fields. Internal
request logs follow `LOG_INTERNAL_REQUESTS` for both outputs.

If your collector also ingests console output, the same Python log record can
arrive twice. For console-only collection, keep `OTEL_LOGS_EXPORTER=none`.
When using direct export, exclude duplicate console records in your collector.
Keep a collection path for any required output that goes straight to stdout or
stderr, such as `print()` output or subprocess logs. Console collection,
job-launcher logging, and Files log storage and queries operate independently
of the Python logging handler.

## GenAI workload telemetry

To collect spans, metrics, and events for AI operations, instrument your workload
using the [OpenTelemetry GenAI semantic conventions](https://github.com/open-telemetry/semantic-conventions-genai).
The conventions define attributes such as `gen_ai.operation.name`,
`gen_ai.provider.name`, and input and output token counts. For supported
ingestion paths, see [Collect Agent Traces](/nemo-helix/v0.12/documentation/agents/traces-and-insights/collect-agent-traces).

Make recording prompts, completions, and tool-call inputs and outputs opt-in.
The Python application log filter applies to log records marked as sensitive.
Configure content capture separately in your workload instrumentation.