From d34e1329c824a12838f1fddcc15545b11888414a Mon Sep 17 00:00:00 2001 From: Dmitrii Stepanov Date: Wed, 12 Feb 2025 14:17:18 +0300 Subject: [PATCH] [#20] metrics: Add grpc msg send metrics Streaming RPC has two main metrics: send message and receive message. But the first one was missed. Signed-off-by: Dmitrii Stepanov --- metrics/grpc/client.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/metrics/grpc/client.go b/metrics/grpc/client.go index bbc7691..fc5a74a 100644 --- a/metrics/grpc/client.go +++ b/metrics/grpc/client.go @@ -15,6 +15,9 @@ var clientMetrics = grpcprom.NewClientMetrics( grpcprom.WithClientStreamRecvHistogram( grpcprom.WithHistogramBuckets(prometheus.DefBuckets), ), + grpcprom.WithClientStreamSendHistogram( + grpcprom.WithHistogramBuckets(prometheus.DefBuckets), + ), ) func init() { @@ -57,6 +60,12 @@ func init() { Help: "Histogram of response latency (seconds) of the gRPC single message receive.", VariableLabels: []string{"grpc_type", "grpc_service", "grpc_method"}, }, + { + Name: "grpc_client_msg_send_handling_seconds", + Type: dto.MetricType_HISTOGRAM.String(), + Help: "Histogram of response latency (seconds) of the gRPC single message send.", + VariableLabels: []string{"grpc_type", "grpc_service", "grpc_method"}, + }, } metrics.MustRegister(clientMetrics, descs...) } -- 2.45.3