Documentation ¶
Index ¶
Constants ¶
const ( GrafanaBackend = "grafana" ProxyBackend = "proxy" Namespace = "grafana" Subsystem = "alerting" )
Variables ¶
This section is empty.
Functions ¶
func Instrument ¶
Instrument wraps a middleware, instrumenting the request latencies.
func MakeLabelValue ¶
MakeLabelValue normalizes a path template
Types ¶
type API ¶
type API struct {
RequestDuration *prometheus.HistogramVec
}
type Alertmanager ¶
type Alertmanager struct { Registerer prometheus.Registerer *metrics.Alerts }
func NewAlertmanagerMetrics ¶
func NewAlertmanagerMetrics(r prometheus.Registerer) *Alertmanager
NewAlertmanagerMetrics creates a set of metrics for the Alertmanager of each organization.
type MultiOrgAlertmanager ¶
type MultiOrgAlertmanager struct { Registerer prometheus.Registerer ActiveConfigurations prometheus.Gauge DiscoveredConfigurations prometheus.Gauge // contains filtered or unexported fields }
func (*MultiOrgAlertmanager) GetOrCreateOrgRegistry ¶
func (moa *MultiOrgAlertmanager) GetOrCreateOrgRegistry(id int64) prometheus.Registerer
GetOrCreateOrgRegistry gets or creates a *prometheus.Registry for the specified org. It is safe to call concurrently.
func (*MultiOrgAlertmanager) RemoveOrgRegistry ¶
func (moa *MultiOrgAlertmanager) RemoveOrgRegistry(id int64)
RemoveOrgRegistry removes the *prometheus.Registry for the specified org. It is safe to call concurrently.
type NGAlert ¶
type NGAlert struct { // Registerer is for use by subcomponents which register their own metrics. Registerer prometheus.Registerer // contains filtered or unexported fields }
func NewNGAlert ¶
func NewNGAlert(r prometheus.Registerer) *NGAlert
NewNGAlert manages the metrics of all the alerting components.
func ProvideServiceForTest ¶
func ProvideServiceForTest() *NGAlert
ProvideServiceForTest is a Metrics factory used for test.
func (*NGAlert) GetAPIMetrics ¶
func (*NGAlert) GetMultiOrgAlertmanagerMetrics ¶
func (ng *NGAlert) GetMultiOrgAlertmanagerMetrics() *MultiOrgAlertmanager
func (*NGAlert) GetSchedulerMetrics ¶
func (*NGAlert) GetStateMetrics ¶
type OrgRegistries ¶
type OrgRegistries struct {
// contains filtered or unexported fields
}
OrgRegistries represents a map of registries per org.
func NewOrgRegistries ¶
func NewOrgRegistries() *OrgRegistries
func (*OrgRegistries) GetOrCreateOrgRegistry ¶
func (m *OrgRegistries) GetOrCreateOrgRegistry(orgID int64) prometheus.Registerer
GetOrCreateOrgRegistry gets or creates a *prometheus.Registry for the specified org. It is safe to call concurrently.
func (*OrgRegistries) RemoveOrgRegistry ¶
func (m *OrgRegistries) RemoveOrgRegistry(org int64)
RemoveOrgRegistry removes the *prometheus.Registry for the specified org. It is safe to call concurrently.
type Scheduler ¶
type Scheduler struct { Registerer prometheus.Registerer EvalTotal *prometheus.CounterVec EvalFailures *prometheus.CounterVec EvalDuration *prometheus.SummaryVec }
type State ¶
type State struct { GroupRules *prometheus.GaugeVec AlertState *prometheus.GaugeVec }