mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
33 lines
1.0 KiB
Go
33 lines
1.0 KiB
Go
|
|
package metrics
|
||
|
|
|
||
|
|
import (
|
||
|
|
"github.com/prometheus/client_golang/prometheus"
|
||
|
|
"github.com/prometheus/client_golang/prometheus/promauto"
|
||
|
|
)
|
||
|
|
|
||
|
|
type MultiOrgAlertmanager struct {
|
||
|
|
Registerer prometheus.Registerer
|
||
|
|
ActiveConfigurations prometheus.Gauge
|
||
|
|
DiscoveredConfigurations prometheus.Gauge
|
||
|
|
registries *OrgRegistries
|
||
|
|
}
|
||
|
|
|
||
|
|
func NewMultiOrgAlertmanagerMetrics(r prometheus.Registerer) *MultiOrgAlertmanager {
|
||
|
|
return &MultiOrgAlertmanager{
|
||
|
|
Registerer: r,
|
||
|
|
registries: NewOrgRegistries(),
|
||
|
|
DiscoveredConfigurations: promauto.With(r).NewGauge(prometheus.GaugeOpts{
|
||
|
|
Namespace: Namespace,
|
||
|
|
Subsystem: Subsystem,
|
||
|
|
Name: "discovered_configurations",
|
||
|
|
Help: "The number of organizations we've discovered that require an Alertmanager configuration.",
|
||
|
|
}),
|
||
|
|
ActiveConfigurations: promauto.With(r).NewGauge(prometheus.GaugeOpts{
|
||
|
|
Namespace: Namespace,
|
||
|
|
Subsystem: Subsystem,
|
||
|
|
Name: "active_configurations",
|
||
|
|
Help: "The number of active Alertmanager configurations.",
|
||
|
|
}),
|
||
|
|
}
|
||
|
|
}
|