Skip to content
Discussion options

You must be logged in to vote

Use a ServiceMonitor with the Prometheus operator rather than scrape annotations.

Steps that work cleanly on k3s:

  1. Run DCGM exporter as a DaemonSet with a headless Service exposing port 9400 (name it metrics).
  2. Create a ServiceMonitor selecting that Service; set honorLabels: true so exporter-provided labels win.
  3. DCGM already emits gpu, UUID, modelName, Hostname labels per metric — with honorLabels they flow straight into Prometheus, no manual relabeling.
  4. In Grafana, template a $gpu variable on label_values(DCGM_FI_DEV_GPU_UTIL, gpu) and key panels off UUID.

Annotation-based scraping also works but you lose the operators native target management and have to relabel by hand, so the ServiceM…

Replies: 1 comment

Comment options

iacker
Jul 10, 2026
Maintainer Author

You must be logged in to vote
0 replies
Answer selected by iacker
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant