diff --git a/agent/grpc/stats.go b/agent/grpc/stats.go index 16961e7f0a..c37d1f9bf6 100644 --- a/agent/grpc/stats.go +++ b/agent/grpc/stats.go @@ -60,7 +60,7 @@ func (c *statsHandler) HandleConn(_ context.Context, s stats.ConnStats) { // Decrement! count = atomic.AddUint64(&c.activeConns, ^uint64(0)) } - c.metrics.SetGauge([]string{"grpc", label, "active_conns"}, float32(count)) + c.metrics.SetGauge([]string{"grpc", label, "connections"}, float32(count)) } type activeStreamCounter struct { @@ -79,10 +79,10 @@ func (i *activeStreamCounter) Intercept( handler grpc.StreamHandler, ) error { count := atomic.AddUint64(&i.count, 1) - i.metrics.SetGauge([]string{"grpc", "server", "active_streams"}, float32(count)) + i.metrics.SetGauge([]string{"grpc", "server", "streams"}, float32(count)) defer func() { count := atomic.AddUint64(&i.count, ^uint64(0)) - i.metrics.SetGauge([]string{"grpc", "server", "active_streams"}, float32(count)) + i.metrics.SetGauge([]string{"grpc", "server", "streams"}, float32(count)) }() return handler(srv, ss) diff --git a/agent/grpc/stats_test.go b/agent/grpc/stats_test.go index ea4cb70b24..9d4772142a 100644 --- a/agent/grpc/stats_test.go +++ b/agent/grpc/stats_test.go @@ -80,10 +80,10 @@ func TestHandler_EmitsStats(t *testing.T) { cmpMetricCalls := cmp.AllowUnexported(metricCall{}) expectedGauge := []metricCall{ - {key: []string{"testing", "grpc", "server", "active_conns"}, val: 1}, - {key: []string{"testing", "grpc", "server", "active_streams"}, val: 1}, - {key: []string{"testing", "grpc", "server", "active_conns"}, val: 0}, - {key: []string{"testing", "grpc", "server", "active_streams"}, val: 0}, + {key: []string{"testing", "grpc", "server", "connections"}, val: 1}, + {key: []string{"testing", "grpc", "server", "streams"}, val: 1}, + {key: []string{"testing", "grpc", "server", "connections"}, val: 0}, + {key: []string{"testing", "grpc", "server", "streams"}, val: 0}, } assertDeepEqual(t, expectedGauge, sink.gaugeCalls, cmpMetricCalls)