From 3ea1149681018e703a5c81f7d60e78adf1a13b88 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Sat, 4 Jan 2020 14:52:07 -0600 Subject: [PATCH] Qualified influx metric names --- cmd/mc-router/metrics.go | 8 ++++---- server/connector.go | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cmd/mc-router/metrics.go b/cmd/mc-router/metrics.go index dfc6bf3..e3c9999 100644 --- a/cmd/mc-router/metrics.go +++ b/cmd/mc-router/metrics.go @@ -105,9 +105,9 @@ func (b *influxMetricsBuilder) BuildConnectorMetrics() *server.ConnectorMetrics b.metrics = metrics return &server.ConnectorMetrics{ - Errors: metrics.NewCounter("errors"), - BytesTransmitted: metrics.NewCounter("transmitted_bytes"), - Connections: metrics.NewCounter("connections"), - ActiveConnections: metrics.NewGauge("connections_active"), + Errors: metrics.NewCounter("mc_router_errors"), + BytesTransmitted: metrics.NewCounter("mc_router_transmitted_bytes"), + Connections: metrics.NewCounter("mc_router_connections"), + ActiveConnections: metrics.NewGauge("mc_router_connections_active"), } } diff --git a/server/connector.go b/server/connector.go index bce9c52..2d8f868 100644 --- a/server/connector.go +++ b/server/connector.go @@ -78,7 +78,7 @@ func (c *connectorImpl) acceptConnections(ctx context.Context, ln net.Listener, } func (c *connectorImpl) HandleConnection(ctx context.Context, frontendConn net.Conn) { - c.metrics.Connections.With("direction", "frontend").Add(1) + c.metrics.Connections.With("side", "frontend").Add(1) //noinspection GoUnhandledErrorResult defer frontendConn.Close() @@ -185,7 +185,7 @@ func (c *connectorImpl) findAndConnectBackend(ctx context.Context, frontendConn return } - c.metrics.Connections.With("direction", "backend", "host", resolvedHost).Add(1) + c.metrics.Connections.With("side", "backend", "host", resolvedHost).Add(1) c.metrics.ActiveConnections.Add(1) defer c.metrics.ActiveConnections.Add(-1)