mirror of
https://github.com/tarampampam/error-pages.git
synced 2024-08-30 18:22:40 +00:00
21 lines
573 B
Go
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
|
|
}
|