mirror of
https://github.com/itzg/mc-router.git
synced 2024-11-28 12:35:21 +01:00
Qualified influx metric names
This commit is contained in:
parent
8d63f76a66
commit
3ea1149681
@ -105,9 +105,9 @@ func (b *influxMetricsBuilder) BuildConnectorMetrics() *server.ConnectorMetrics
|
|||||||
b.metrics = metrics
|
b.metrics = metrics
|
||||||
|
|
||||||
return &server.ConnectorMetrics{
|
return &server.ConnectorMetrics{
|
||||||
Errors: metrics.NewCounter("errors"),
|
Errors: metrics.NewCounter("mc_router_errors"),
|
||||||
BytesTransmitted: metrics.NewCounter("transmitted_bytes"),
|
BytesTransmitted: metrics.NewCounter("mc_router_transmitted_bytes"),
|
||||||
Connections: metrics.NewCounter("connections"),
|
Connections: metrics.NewCounter("mc_router_connections"),
|
||||||
ActiveConnections: metrics.NewGauge("connections_active"),
|
ActiveConnections: metrics.NewGauge("mc_router_connections_active"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -78,7 +78,7 @@ func (c *connectorImpl) acceptConnections(ctx context.Context, ln net.Listener,
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *connectorImpl) HandleConnection(ctx context.Context, frontendConn net.Conn) {
|
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
|
//noinspection GoUnhandledErrorResult
|
||||||
defer frontendConn.Close()
|
defer frontendConn.Close()
|
||||||
|
|
||||||
@ -185,7 +185,7 @@ func (c *connectorImpl) findAndConnectBackend(ctx context.Context, frontendConn
|
|||||||
return
|
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)
|
c.metrics.ActiveConnections.Add(1)
|
||||||
defer c.metrics.ActiveConnections.Add(-1)
|
defer c.metrics.ActiveConnections.Add(-1)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user