How nvidia/dcgm-exporter works
DCGM Exporter is a Go service that exposes NVIDIA GPU telemetry as Prometheus text metrics. Its primary workflow starts in the exporter command, initializes configuration and GPU telemetry providers, watches selected device fields, collects and transforms values into a registry, then serves rendered metrics to Prometheus scrapes. The source tree also identifies Kubernetes-related metadata and specialized collectors for GPU health, XID errors, clocks, peer-to-peer status, and profiling. The sampled excerpts confirm CLI initialization, watch-list setup, reload coordination, and serving behavior; some subsystem links are therefore omitted where call ownership was not visible.
Main entry points: app.go Reload coordinator · devicewatchlistmanager Watch-list manager · registry Metric registry · collector Metric collectors
Components 17
Startup and lifecycle
- Exporter CLI
pkg/cmd/app.go - Configuration
internal/pkg/appconfig - Reload coordinator
pkg/cmd/app.go
Telemetry collection
- DCGM provider
internal/pkg/dcgmprovider - NVML provider
internal/pkg/nvmlprovider - Device inventory
internal/pkg/deviceinfo - Watch-list manager
internal/pkg/devicewatchlistmanager - Field watcher
internal/pkg/devicewatcher
Metric processing
- Metric collectors
internal/pkg/collector - Counter definitions
internal/pkg/counters - Metric transformation
internal/pkg/transformation - Metric registry
internal/pkg/registry - Kubernetes metadata
internal/pkg/kubeclient
HTTP serving
- Prometheus rendering
internal/pkg/rendermetrics - Metrics server
internal/pkg/server
Other components
- Operator
- Prometheus
Connections 17
- Operator → Exporter CLI: starts
- Exporter CLI → Configuration: loads
- Exporter CLI → Reload coordinator: coordinates
- Reload coordinator → DCGM provider: initializes
- Reload coordinator → NVML provider: initializes
- Reload coordinator → Metric registry: builds
- Watch-list manager → Configuration: reads policy
- Watch-list manager → Device inventory: initializes
- Watch-list manager → Field watcher: registers fields
- Field watcher → DCGM provider: watches fields
- Metric collectors → Counter definitions: uses definitions
- Metric collectors → Watch-list manager: reads watched values
- Metric collectors → Metric registry: registers metrics
- Metric registry → Metric transformation: transforms metrics
- Metrics server → Metric registry: serves registry
- Metrics server → Prometheus rendering: renders metrics
- Prometheus → Metrics server: scrapes