Skip to content

Commit

Permalink
Qualified influx metric names
Browse files Browse the repository at this point in the history
  • Loading branch information
itzg committed Jan 4, 2020
1 parent 8d63f76 commit 3ea1149
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions cmd/mc-router/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
}
}
4 changes: 2 additions & 2 deletions server/connector.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit 3ea1149

Please sign in to comment.