Attribute DCGM exporter metrics to pods on DRA nodes by default - #2706
Open
rajathagasthya wants to merge 1 commit into
Open
Attribute DCGM exporter metrics to pods on DRA nodes by default#2706rajathagasthya wants to merge 1 commit into
rajathagasthya wants to merge 1 commit into
Conversation
Under GPUCluster, dcgm-exporter metrics carry only hardware labels: no pod, namespace, container or dra_* label appears unless the user sets dcgmExporter.enablePodLabels. Under ClusterPolicy the same three pod labels are present out of the box, so migrating to GPUCluster silently loses metric attribution. The two modes reach attribution differently. The kubelet reports device-plugin allocations as GPU UUIDs, which the exporter can match against DCGM directly from the pod-resources socket with no API access. DRA allocations are reported as (pool, device) names instead, so the exporter must read the ResourceSlice published for the node to resolve them back to a UUID. That needs a ServiceAccount token and read access to resourceslices, both of which were gated behind the pod-labels flag along with KUBERNETES_ENABLE_DRA itself. Render the DRA env var, the token mount and the read ClusterRole and binding unconditionally. Attribution is not an opt-in feature in either mode now; enablePodLabels and enablePodUID go back to controlling only the pod-label and pod-UID enrichment they are named for. Neither is defaulted on: with no allowlist configured the exporter copies every pod label onto every GPU metric series, which is left to the operator to opt into deliberately. PodMetadataEnabled had no remaining template consumers and is removed. Signed-off-by: Rajath Agasthya <ragasthya@nvidia.com>
rajathagasthya
marked this pull request as ready for review
July 31, 2026 22:18
rajathagasthya
requested review from
cdesiniotis,
karthikvetrivel,
rahulait,
shivamerla and
tariq1890
as code owners
July 31, 2026 22:18
Contributor
Author
|
@karthikvetrivel From my testing:
Not sure if you're already aware of this issue. This needs to be reported to upstream DCGM Exporter. |
cdesiniotis
approved these changes
Jul 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Under GPUCluster, dcgm-exporter metrics carry only hardware labels (no
pod,namespace,containerordra_*) unlessdcgmExporter.enablePodLabelsis set. ClusterPolicy has those labels by default, so migrating to GPUCluster silently loses attribution.The kubelet reports device-plugin allocations as GPU UUIDs, which the exporter gets from the pod-resources socket with no API access. DRA allocations are reported as
(pool, device)names instead, so the exporter has to read the node's ResourceSlice to resolve them back to a UUID. That needs a ServiceAccount token and read access toresourceslices— both of which, along withKUBERNETES_ENABLE_DRAitself, were gated behind the pod-labels flag.Render the DRA env var, token mount and ClusterRole/binding unconditionally.
enablePodLabelsandenablePodUIDcontrols their behavior appropriately.Builds on #2697, which added the env var and the
resourceslicesgrant, but gated them behindPodMetadataEnabledgate.PodMetadataEnablednow has no remaining consumers and is removed.Checklist
make lint)make validate-generated-assets)make validate-modules)Testing
Verified on a GH200 node, driver 595.71.05, with a single DRA workload holding one GPU.
With PR changes
Default pod attribution (pod label and pod UID false) — matches current ClusterPolicy behavior
No pod label leakage
With pod label and UID enabled (no pod UID?)
The absent pod UID is not caused by this change. dcgm-exporter never sets the UID attribute on its DRA path, so
DCGM_EXPORTER_KUBERNETES_ENABLE_POD_UIDhas no effect on DRA-attributed metrics. The ClusterPolicy run below showspod_uidpresent on the same exporter build, which confirms the gap in DRA path.Without PR changes
No match (pod labels and pod UID false) - current bug
v26.7.0-rc.4, which predates #2697 and never sets
KUBERNETES_ENABLE_DRAso no pods are matched.$ curl -s localhost:9400/metrics | grep 'pod="gpu-workload-dra-859cdbfb47-9g7gs"' | head -1All metrics
Pod labels (and pod UID) enabled — with PR #2697
Attribution works once
enablePodLabels=trueis set, confirming the gate is the only thing this PR changes.ClusterPolicy
No regression.
Default attribution
Pod labels and pod uid enabled (app=gpu-workload)