error-pages/internal/metrics/registry.go
2022-01-28 20:42:08 +05:00

21 lines
573 B
Go

// 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
}