error-pages/internal/metrics/registry.go

21 lines
573 B
Go
Raw Normal View History

2022-01-28 15:42:08 +00:00
// Package metrics contains custom prometheus metrics and registry factories.
package metrics
import (
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/collectors"
)
// NewRegistry creates new prometheus registry with pre-registered common collectors.
func NewRegistry() *prometheus.Registry {
registry := prometheus.NewRegistry()
// register common metric collectors
registry.MustRegister(
// collectors.NewGoCollector(),
collectors.NewProcessCollector(collectors.ProcessCollectorOpts{}),
)
return registry
}