diff --git a/internal/scheduler/metrics/metrics.go b/internal/scheduler/metrics/metrics.go index da578cea950..4bfa38d7b6b 100644 --- a/internal/scheduler/metrics/metrics.go +++ b/internal/scheduler/metrics/metrics.go @@ -329,7 +329,11 @@ func appendLabelsFromJobSchedulingContext(labels []string, jctx *schedulercontex executor, nodeName := executorAndNodeNameFromRun(job.LatestRun()) labels = append(labels, job.GetQueue()) labels = append(labels, executor) - labels = append(labels, jctx.PodSchedulingContext.WellKnownNodeTypeName) + wellKnownNodeType := "" + if pctx := jctx.PodSchedulingContext; pctx != nil { + wellKnownNodeType = pctx.WellKnownNodeTypeName + } + labels = append(labels, wellKnownNodeType) labels = append(labels, nodeName) return labels }