Skip to content

Commit c1cd849

Browse files
committed
kubelet: define custom buckets for DRA metrics
1 parent 9a044cd commit c1cd849

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

pkg/kubelet/metrics/metrics.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,11 @@ var (
173173
{60 * 1024 * 1024 * 1024, "60GB-100GB"},
174174
{100 * 1024 * 1024 * 1024, "GT100GB"},
175175
}
176+
// DRADurationBuckets is the bucket boundaries for DRA operation duration metrics
177+
// DRAOperationsDuration and DRAGRPCOperationsDuration defined below in this file.
178+
// The buckets max value 40 is based on the 45sec max gRPC timeout value defined
179+
// for the DRA gRPC calls in the pkg/kubelet/cm/dra/plugin/registration.go
180+
DRADurationBuckets = metrics.ExponentialBucketsRange(.1, 40, 15)
176181
)
177182

178183
var (
@@ -950,7 +955,7 @@ var (
950955
Subsystem: DRASubsystem,
951956
Name: DRAOperationsDurationKey,
952957
Help: "Latency histogram in seconds for the duration of handling all ResourceClaims referenced by a pod when the pod starts or stops. Identified by the name of the operation (PrepareResources or UnprepareResources) and separated by the success of the operation. The number of failed operations is provided through the histogram's overall count.",
953-
Buckets: metrics.DefBuckets,
958+
Buckets: DRADurationBuckets,
954959
StabilityLevel: metrics.ALPHA,
955960
},
956961
[]string{"operation_name", "is_error"},
@@ -962,7 +967,7 @@ var (
962967
Subsystem: DRASubsystem,
963968
Name: DRAGRPCOperationsDurationKey,
964969
Help: "Duration in seconds of the DRA gRPC operations",
965-
Buckets: metrics.DefBuckets,
970+
Buckets: DRADurationBuckets,
966971
StabilityLevel: metrics.ALPHA,
967972
},
968973
[]string{"driver_name", "method_name", "grpc_status_code"},

0 commit comments

Comments
 (0)