codies/internal/server/metrics.go

44 lines
1.0 KiB
Go
Raw Normal View History

2020-05-25 05:18:35 +00:00
package server
import (
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
)
var (
metricRooms = promauto.NewGauge(prometheus.GaugeOpts{
Namespace: "codies",
Subsystem: "codies",
Name: "rooms",
Help: "Total number of rooms.",
})
metricClients = promauto.NewGauge(prometheus.GaugeOpts{
Namespace: "codies",
Subsystem: "codies",
Name: "clients",
Help: "Total number of clients.",
})
2020-05-27 06:40:29 +00:00
metricReceived = promauto.NewCounter(prometheus.CounterOpts{
2020-05-25 05:18:35 +00:00
Namespace: "codies",
Subsystem: "codies",
2020-05-27 06:27:09 +00:00
Name: "received_total",
Help: "Total number of received messages.",
2020-05-25 05:18:35 +00:00
})
metricSent = promauto.NewCounter(prometheus.CounterOpts{
Namespace: "codies",
Subsystem: "codies",
Name: "sent_total",
Help: "Total number of sent messages.",
})
2020-06-13 04:16:24 +00:00
metricHandleErrors = promauto.NewCounter(prometheus.CounterOpts{
Namespace: "codies",
Subsystem: "codies",
Name: "handle_error_total",
Help: "Total number of handle errors.",
})
2020-05-25 05:18:35 +00:00
)