Metrics

Prometheus metrics exposed by the driver.

The driver exposes Prometheus metrics on the existing HTTP /metrics endpoint served by --bind-address (default :8080).

Custom driver metrics can also be listed programmatically without starting the driver:

dracpu introspect metrics

The command prints JSON metadata for custom dra_cpu_* metrics only. It does not include default Go runtime, process, or Prometheus client metrics.

MetricTypeLabelsDescription
dra_cpu_allocated_cpusGaugenoneCPUs currently allocated to prepared resource claims.
dra_cpu_available_cpusGaugenoneCPUs still available for allocation after reserved and active claim CPUs are excluded.
dra_cpu_reserved_cpusGaugenoneCPUs excluded from DRA management by driver configuration.
dra_cpu_resource_claims_activeGaugenoneResource claims currently recorded as active by the allocation store.
dra_cpu_prepare_claims_totalCounterresultPer-claim PrepareResourceClaims results. result is success, error, or unknown.
dra_cpu_unprepare_claims_totalCounterresultPer-claim UnprepareResourceClaims results. result is success, error, or unknown.
dra_cpu_prepare_claim_duration_secondsHistogramnonePer-claim prepare latency in seconds.
dra_cpu_unprepare_claim_duration_secondsHistogramnonePer-claim unprepare latency in seconds.
dra_cpu_claim_allocated_cpusHistogramnoneCPUs allocated for each newly successful claim allocation.
dra_cpu_nri_synchronize_duration_secondsHistogramresultDuration of the NRI Synchronize callback in seconds. result is success or error.
dra_cpu_nri_create_container_duration_secondsHistogramresult, cpu_allocation_modeDuration of the NRI CreateContainer callback in seconds. result is success or error; cpu_allocation_mode is shared or exclusive.
dra_cpu_nri_stop_container_duration_secondsHistogramresult, cpu_allocation_modeDuration of the NRI StopContainer callback in seconds. result is success or error; cpu_allocation_mode is shared or exclusive.
dra_cpu_nri_remove_container_duration_secondsHistogramresult, cpu_allocation_modeDuration of the NRI RemoveContainer callback in seconds. result is success or error; cpu_allocation_mode is shared or exclusive.

Note about dra_cpu_nri_remove_container_duration_seconds: due to how the driver is implemented and how it uses the NRI APIs, this metric reports cases on which the hook recovered an internal faulty state. The cleanup action should be carried at the StopContainer stage and the real work should be reflected in dra_cpu_nri_stop_container_duration_seconds. Note this is a current implementation detail which leaks in the metrics, and it is subject to change in the next releases.

The custom metrics intentionally avoid labels for namespace, pod, claim, device, node, socket, NUMA node, group mode, and error reason. Those labels would either be high-cardinality or need more API design before becoming part of the driver’s metric surface. Node identity should come from scrape target labels.

The NRI callback histograms use bucket boundaries tailored to the NRI plugin request timeout. This serves both performance and reliability concerns, because the runtime close the plugin connection if a callback does not return within the configured request timeout (2 seconds by default).