From fb707f05a62052f1db6912cf4096d053b64385ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20=C5=A0ediv=C3=BD?= Date: Mon, 4 Jul 2022 00:48:29 +0200 Subject: [PATCH] join bytes by a label. --- internal/webrtc/metrics.go | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/internal/webrtc/metrics.go b/internal/webrtc/metrics.go index 066f011b..c386e0d3 100644 --- a/internal/webrtc/metrics.go +++ b/internal/webrtc/metrics.go @@ -105,40 +105,44 @@ func (m *metricsCtx) getBySession(session types.Session) metrics { }), iceBytesSent: promauto.NewGauge(prometheus.GaugeOpts{ - Name: "ice_bytes_sent", + Name: "bytes_sent", Namespace: "neko", Subsystem: "webrtc", - Help: "Sent bytes using ICE transport to a session.", + Help: "Sent bytes to a session.", ConstLabels: map[string]string{ "session_id": session.ID(), + "transport": "ice", }, }), iceBytesReceived: promauto.NewGauge(prometheus.GaugeOpts{ - Name: "ice_bytes_received", + Name: "bytes_received", Namespace: "neko", Subsystem: "webrtc", - Help: "Received bytes using ICE transport from a session.", + Help: "Received bytes from a session.", ConstLabels: map[string]string{ "session_id": session.ID(), + "transport": "ice", }, }), sctpBytesSent: promauto.NewGauge(prometheus.GaugeOpts{ - Name: "sctp_bytes_sent", + Name: "bytes_sent", Namespace: "neko", Subsystem: "webrtc", - Help: "Sent bytes using SCTP transport to a session.", + Help: "Sent bytes to a session.", ConstLabels: map[string]string{ "session_id": session.ID(), + "transport": "sctp", }, }), sctpBytesReceived: promauto.NewGauge(prometheus.GaugeOpts{ - Name: "sctp_bytes_received", + Name: "bytes_received", Namespace: "neko", Subsystem: "webrtc", - Help: "Received bytes using SCTP transport from a session.", + Help: "Received bytes from a session.", ConstLabels: map[string]string{ "session_id": session.ID(), + "transport": "sctp", }, }), }