28 lines
800 B
Go
28 lines
800 B
Go
package metrics
|
|
|
|
import (
|
|
"github.com/prometheus/client_golang/prometheus"
|
|
"github.com/prometheus/client_golang/prometheus/promauto"
|
|
)
|
|
|
|
var (
|
|
ConnectedClients = promauto.NewGauge(prometheus.GaugeOpts{
|
|
Name: "websocket_connected_clients",
|
|
Help: "Number of currently connected WebSocket clients",
|
|
})
|
|
|
|
MessagesTotal = promauto.NewCounter(prometheus.CounterOpts{
|
|
Name: "websocket_messages_total",
|
|
Help: "Total number of WebSocket messages processed",
|
|
})
|
|
|
|
ConnectionsTotal = promauto.NewCounter(prometheus.CounterOpts{
|
|
Name: "websocket_connections_total",
|
|
Help: "Total number of WebSocket connections established",
|
|
})
|
|
|
|
DisconnectionsTotal = promauto.NewCounter(prometheus.CounterOpts{
|
|
Name: "websocket_disconnections_total",
|
|
Help: "Total number of WebSocket disconnections",
|
|
})
|
|
) |