Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Case ¶
type Case interface { prometheus.Collector Name() string }
Case represents a metric that can be used for exporting, then verified against an Alertmanager webhook
func NewGaugeCase ¶
NewGaugeCase creates a gauge metric that exposes the current time when collected.
type CortexClient ¶
type CortexClient interface { CreateAlertmanagerConfig(ctx context.Context, cfg string, templates map[string]string) error CreateRuleGroup(ctx context.Context, namespace string, rg rwrulefmt.RuleGroup) error }
CortexClient represents a client for syncing ruler and alertmanager configuration with Cortex
type GaugeCase ¶
type GaugeCase struct { prometheus.GaugeFunc // contains filtered or unexported fields }
GaugeCase represents a case in the form of a gauge
type Receiver ¶
type Receiver struct {
// contains filtered or unexported fields
}
Receiver implements the Alertmanager webhook receiver. It evaluates the received alerts, finds if the alert holds an annonnation with a label of "time", and if it does computes now - time for a total duration.
func NewReceiver ¶
func NewReceiver(cfg ReceiverConfig, log log.Logger, reg prometheus.Registerer) (*Receiver, error)
NewReceiver returns an alertmanager webhook receiver
func (*Receiver) RegisterRoutes ¶
RegisterRoutes registers the receiver API routes with the provided router.
type ReceiverConfig ¶
type ReceiverConfig struct { RoundtripLabel string PurgeLookback time.Duration PurgeInterval time.Duration }
ReceiverConfig implements the configuration for the alertmanager webhook receiver
func (*ReceiverConfig) RegisterFlags ¶
func (cfg *ReceiverConfig) RegisterFlags(f *flag.FlagSet)
RegisterFlags registers the flags for the alertmanager webhook receiver
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
Runner runs a set of cases for evaluation
func NewRunner ¶
func NewRunner(cfg RunnerConfig, logger log.Logger) (*Runner, error)
NewRunner returns a runner that holds cases for collection and evaluation.
func (*Runner) Collect ¶
func (r *Runner) Collect(c chan<- prometheus.Metric)
Collect implements prometheus.Collector.
func (*Runner) Describe ¶
func (r *Runner) Describe(c chan<- *prometheus.Desc)
Describe implements prometheus.Collector.
type RunnerConfig ¶
type RunnerConfig struct { AlertmanagerURL string AlertmanagerID string RulerURL string RulerID string Key string RulesConfigFile string AlertmanagerConfigFile string ConfigSyncInterval time.Duration }
func (*RunnerConfig) RegisterFlags ¶
func (cfg *RunnerConfig) RegisterFlags(f *flag.FlagSet)