Prometheus counter for Signal/RTC messages (#139)

This commit is contained in:
Mathew Kamkar
2021-10-08 12:02:08 -07:00
committed by GitHub
parent 2c9ef2f6bb
commit b212fb9a9e
5 changed files with 27 additions and 8 deletions
+11 -1
View File
@@ -9,15 +9,25 @@ import (
"github.com/pion/rtcp"
"github.com/pion/rtp"
"github.com/pion/transport/packetio"
"github.com/prometheus/client_golang/prometheus"
)
const livekitNamespace = "livekit"
var (
promLabels = []string{"direction"}
PromMessageCounter = prometheus.NewCounterVec(
prometheus.CounterOpts{
Namespace: livekitNamespace,
Subsystem: "node",
Name: "messages",
},
[]string{"type", "status"},
)
)
func init() {
prometheus.MustRegister(PromMessageCounter)
initPacketStats()
initRoomStatsReporter()
}