Skip to content

Commit 2048b7b

Browse files
committed
kubelet: add DRAGRPCOperationsDuration metric
1 parent a21f3f0 commit 2048b7b

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

pkg/kubelet/metrics/metrics.go

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,8 @@ const (
134134
ContainerAlignedComputeResourcesBoundaryLabelKey = "boundary"
135135

136136
// Metric keys for DRA operations
137-
DRAOperationsDurationKey = "operations_duration_seconds"
137+
DRAOperationsDurationKey = "operations_duration_seconds"
138+
DRAGRPCOperationsDurationKey = "grpc_operations_duration_seconds"
138139

139140
// Values used in metric labels
140141
Container = "container"
@@ -954,6 +955,18 @@ var (
954955
},
955956
[]string{"operation_name", "is_error"},
956957
)
958+
959+
// DRAGRPCOperationsDuration tracks the duration of the DRA GRPC operations.
960+
DRAGRPCOperationsDuration = metrics.NewHistogramVec(
961+
&metrics.HistogramOpts{
962+
Subsystem: DRASubsystem,
963+
Name: DRAGRPCOperationsDurationKey,
964+
Help: "Duration in seconds of the DRA gRPC operations",
965+
Buckets: metrics.DefBuckets,
966+
StabilityLevel: metrics.ALPHA,
967+
},
968+
[]string{"driver_name", "method_name", "grpc_status_code"},
969+
)
957970
)
958971

959972
var registerMetrics sync.Once
@@ -1049,6 +1062,7 @@ func Register(collectors ...metrics.StableCollector) {
10491062

10501063
if utilfeature.DefaultFeatureGate.Enabled(features.DynamicResourceAllocation) {
10511064
legacyregistry.MustRegister(DRAOperationsDuration)
1065+
legacyregistry.MustRegister(DRAGRPCOperationsDuration)
10521066
}
10531067
})
10541068
}

0 commit comments

Comments
 (0)