autodock is a Daemon for Docker Automation that helps to build automated Docker based infrastructure by integrating with Docker events
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
autodock/metrics/metrics.go

40 lines
763 B

package metrics
import (
"github.com/prometheus/client_golang/prometheus"
)
var (
eventsProcessed = prometheus.NewCounter(
prometheus.CounterOpts{
Namespace: "autodock",
Subsystem: "totals",
Name: "events_processed",
Help: "Total number of events processed",
},
)
uptime = prometheus.NewCounter(
prometheus.CounterOpts{
Namespace: "autodock",
Subsystem: "totals",
Name: "uptime",
Help: "Uptime in seconds",
},
)
)
type Metrics struct {
EventsProcessed prometheus.Counter
Uptime prometheus.Counter
}
func NewMetrics() *Metrics {
prometheus.MustRegister(eventsProcessed)
prometheus.MustRegister(uptime)
return &Metrics{
EventsProcessed: eventsProcessed,
Uptime: uptime,
}
}