dcgm-exporter#
NAME#
dcgm-exporter - expose NVIDIA DCGM telemetry in Prometheus format
SYNOPSIS#
dcgm-exporter [<options>]
dcgm-exporter --help
dcgm-exporter --version
DESCRIPTION#
dcgm-exporter selects DCGM fields, watches them for the requested entities,
adds entity and optional workload labels, and serves the resulting Prometheus
metrics at /metrics. The default listener is :9400.
DCGM Exporter is supported on Linux.
Without --remote-hostengine-info, the exporter initializes an embedded
DCGM host engine inside its process through libdcgm. Supplying that option
connects to a separately managed DCGM host engine instead.
This page describes the program’s behavior and options. For package, container, Helm, and GPU Operator procedures, see Install DCGM Exporter. To configure Prometheus, see Configure Prometheus for DCGM Exporter. For metric families and labels, see DCGM Exporter Metrics.
CONFIGURATION SOURCES#
The setting with the highest priority wins. From highest to lowest:
Command-line flags explicitly supplied at startup.
Environment variables associated with those flags.
Values loaded through
--config-fileorDCGM_EXPORTER_CONFIG_FILE.Built-in defaults.
The startup YAML configures only the metric source and collections. Explicit
--collectors or --configmap-data settings
replace a YAML metric source. If both are explicitly set,
--configmap-data is applied last. The value none selects the collector
file instead of a ConfigMap.
YAML is read at startup. The exporter watches a file-backed collector CSV for
changes; SIGHUP requests the same metric reload. Other flags and
environment variables require a process restart.
OPTIONS#
General Settings#
Option |
Environment variable |
Default |
Behavior |
|---|---|---|---|
|
|
|
Select a three-column collector CSV. |
|
|
Unset |
Load a YAML startup configuration. |
|
|
|
Set the HTTP listen address. Bracket an IPv6 address. |
|
|
|
Set the default DCGM collection interval. |
|
|
Embedded mode |
Connect to a separate DCGM host engine. The option’s displayed value is
|
|
|
|
Omit the |
|
|
|
Replace spaces in |
|
|
|
Skip startup prerequisite checks. Use only in controlled tests. |
|
|
|
Limit the time used to read an HTTP request. |
|
|
|
Limit metric generation and response writing. |
Device and Entity Selection#
Option |
Environment variable |
Default |
Behavior |
|---|---|---|---|
|
|
|
Select GPUs and GPU instances. |
|
|
|
Select NvSwitches and NvLinks. |
|
|
|
Select CPUs and CPU cores. |
|
|
|
Accept fake GPU entities for tests. |
Kubernetes Settings#
Option |
Environment variable |
Default |
Behavior |
|---|---|---|---|
|
|
|
Map metrics to Kubernetes pods. |
|
|
|
Use legacy 1.x pod label names when Kubernetes mapping is enabled. |
|
|
|
Read the |
|
|
|
Set the kubelet pod-resources socket. |
|
|
|
Add pod labels when Kubernetes mapping is enabled. |
|
|
|
Add |
|
|
|
Match pod resources by |
|
|
Empty |
Filter added pod labels with comma-separated regular expressions. An empty value includes all labels when pod-label collection is enabled. |
|
|
Empty |
Recognize additional comma-separated NVIDIA resource names during Kubernetes pod mapping. |
|
|
|
Attribute supported time-sharing or MPS assignments in Kubernetes mode. |
|
|
|
Add metadata from NVIDIA GPU DRA ResourceSlices in Kubernetes mode. |
Runtime and HPC Labels#
Option |
Environment variable |
Default |
Behavior |
|---|---|---|---|
|
|
|
Add non-Kubernetes container labels. Requires a runtime socket and is ignored in Kubernetes mode. |
|
|
Unset |
Set the Docker-compatible runtime socket used for container mapping. |
|
|
Unset |
Read scheduler-created GPU-to-job mapping files. |
Web, Logging, and Diagnostics#
Option |
Environment variable |
Default |
Behavior |
|---|---|---|---|
|
|
Unset |
Load a Prometheus exporter-toolkit TLS and authentication file. |
|
|
|
On Linux, use listeners inherited through systemd socket activation
instead of |
|
|
|
Expose |
|
|
|
Enable debug-level exporter logging. |
|
|
|
Use |
|
|
|
Write DCGM logs to standard output. |
|
|
|
Set |
|
|
|
Set the window used by |
|
|
|
Set the window used by |
|
|
|
Write file-based diagnostic dumps. |
|
|
|
Select the debug-dump directory. |
|
|
|
Set dump retention; |
|
|
|
Enable gzip compression. Use |
|
|
|
Rebuild exporter topology after GPU bind or unbind. Requires DCGM 4.5 or later. |
|
|
|
Set the topology polling interval. A non-positive value is rejected when bind/unbind watching is enabled. |
ENDPOINTS AND SELECTORS#
DCGM Host Engine Endpoints#
--remote-hostengine-info accepts:
host:porttcp://host:portunix:///path/to/socketvsock://cid:port[ipv6-address]:port
The URI forms require DCGM 4.5 or later. The exporter DCGM client library must be the same version as, or newer than, the separate DCGM host engine to connect. Use the tested versions described in the version pairing guidance.
Device Selectors#
Selectors have one of these forms:
fg[:id1[,-id2...]]i[:id1[,-id2...]]a
gselector and aniselector, in either order, joined with+
f selects each full GPU when MIG is disabled and each GPU instance when
MIG is enabled. g selects top-level entities and i selects sub-level
entities. Examples include g:0,2-4, i:0,2-4, g+i,
g:0,2-4+i, and g+i:7.
f cannot be combined with g or i. GPU i selection requires
MIG mode. Explicit IDs must exist, ranges must increase, and an expanded
selector cannot exceed the applicable DCGM entity limit. i+g and g+i
are equivalent.
YAML CONFIGURATION#
Use schema version 2 for YAML startup configurations:
version: 2
metrics:
file: /etc/dcgm-exporter/default-counters.csv
collections:
- name: scrape
every: 30s
metrics:
include: ["*"]
- name: fast-thermals
every: 5s
metrics:
include:
- DCGM_FI_DEV_GPU_TEMP_CELSIUS
- DCGM_FI_DEV_BOARD_POWER_WATTS
Use metrics.file to select a collector CSV or metrics.fields to define
fields inline. Omit metrics to use the default collector. Do not specify
both a file and inline fields.
Each collections entry requires a unique name, a positive every
duration, and a metrics.include list. The scrape collection normally
includes "*" to set the default cadence. More specific collections can
override that cadence for selected field patterns.
An inline field entry requires non-empty name, prometheusType, and
help values. Field names must be unique. Collection durations use positive
Go duration strings expressed in whole milliseconds or larger. Each field
pattern must match a configured field, and two narrower collections cannot
match the same field.
The parser rejects unknown YAML keys, duplicate YAML keys, multiple YAML documents, unsupported schema versions, and ambiguous metric sources.
FILES#
/etc/dcgm-exporter/default-counters.csvDefault collector installed by the package and included in the container.
/etc/dcgm-exporter/dcp-metrics-included.csvCollector preset installed with the package and included in the container. It includes supported profiling fields.
/etc/dcgm-exporter/1.x-compatibility-metrics.csvCollector preset installed with the package and included in the container for legacy metric names and metadata.
- Collector CSV and ConfigMap data
A collector CSV contains exactly three comma-separated columns: a DCGM field name, one of
counter,gauge,untyped, orlabel, and a help message. Lines beginning with#are comments. A ConfigMap selected with--configmap-datamust use the keymetricsand the same CSV format. See Select Metrics and DCGM Exporter Metrics for the field format rules.- Kubelet pod-resources socket
--pod-resources-kubelet-socketnames the Unix socket used for Kubernetes pod attribution. The exporter process must be able to access the mounted socket.- Container runtime socket
--container-runtime-socketnames a Unix socket that implements the Docker-compatible container API. Non-Kubernetes container mapping requires this socket. Mounting it gives the exporter access to privileged runtime metadata; protect it accordingly.- HPC job mapping directory
Each regular file is named
<gpu-id>or<gpu-id>.<gpu-instance-id>. Each line contains one job ID. Matching samples gain anhpc_joblabel and are duplicated when a file contains multiple job IDs. Other filenames and subdirectories are ignored.- Debug dump directory
With
--dump-enabled, the exporter writes JSON snapshots of runtime objects. Filenames include the object type, timestamp, and a random suffix; compression adds.json.gzinstead of.json. The retention task removes files older than--dump-retentionhours. A value of0disables cleanup.
The web configuration follows the Prometheus exporter-toolkit schema. It applies TLS or authentication to the root, health, metrics, and enabled pprof endpoints. Debug dumps can contain device and workload metadata; protect their directory as required by your retention policy.
On Linux, --web-systemd-socket uses listeners passed by the systemd
socket-activation protocol. The packaged service does not enable this option;
an administrator must provide the matching socket unit and service override.
When enabled, those listeners replace --address.
SIGNALS AND LIFETIME#
SIGHUPReload the metric source, just as when a collector file changes. The exporter reuses the YAML, flag, and environment values from startup; it does not reread a changed YAML file without a process restart.
SIGINT,SIGTERM,SIGQUITShut down the exporter.
A metric reload rebuilds watches and the exporter registry. Exporter-owned
cumulative counters are stored only in process memory and reset on reload or
restart. During a hot reload, health responses remain available and report
X-Reload-In-Progress: true.
FAILURES#
Startup fails for malformed device selectors or ConfigMap identifiers, unsupported YAML, invalid exporter log formats or DCGM log levels, an enabled non-positive GPU polling interval, pprof without a web configuration, or container labels without a runtime socket outside Kubernetes.
Invalid duration strings log a warning and use the corresponding default.
Non-positive HTTP timeouts also use their defaults. Collector CSV and
collection errors are reported when the metric source and DCGM field groups
are built. --disable-startup-validate skips prerequisite checks; it does
not make an invalid runtime configuration valid.
EXAMPLES#
Connect to a separate DCGM host engine and use a custom collector:
$ dcgm-exporter \
--remote-hostengine-info tcp://host123:5555 \
--collectors /opt/dcgm-exporter/custom.csv
Listen on IPv6 and select full GPUs plus GPU instances:
$ dcgm-exporter --address "[::]:9400" --devices g+i
Enable protected profiling endpoints:
$ dcgm-exporter \
--web-config-file /etc/dcgm-exporter/web-config.yaml \
--enable-pprof