20 lines
394 B
Go
20 lines
394 B
Go
package global
|
|
|
|
import (
|
|
"git.hlsq.asia/mmorpg/service-common/log"
|
|
"github.com/prometheus/client_golang/prometheus"
|
|
)
|
|
|
|
var (
|
|
OnlineUsersGauge prometheus.Gauge
|
|
)
|
|
|
|
func init() {
|
|
log.Infof("Init prometheus metric...")
|
|
OnlineUsersGauge = prometheus.NewGauge(prometheus.GaugeOpts{
|
|
Name: "online_users",
|
|
Help: "Total number of online users",
|
|
})
|
|
prometheus.MustRegister(OnlineUsersGauge)
|
|
}
|