Documentation ¶
Index ¶
Constants ¶
View Source
const NoopMetadataRecordingRulesGenerator = noopMetadataRecordingRulesGenerator(false)
View Source
const NoopSLIRecordingRulesGenerator = noopSLIRecordingRulesGenerator(false)
View Source
const NoopSLOAlertRulesGenerator = noopSLOAlertRulesGenerator(false)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlertGenerator ¶
type AlertGenerator interface {
GenerateMWMBAlerts(ctx context.Context, slo alert.SLO) (*alert.MWMBAlertGroup, error)
}
AlertGenerator knows how to generate multiwindow multi-burn SLO alerts.
type MetadataRecordingRulesGenerator ¶
type MetadataRecordingRulesGenerator interface {
GenerateMetadataRecordingRules(ctx context.Context, info info.Info, slo prometheus.SLO, alerts alert.MWMBAlertGroup) ([]rulefmt.Rule, error)
}
MetadataRecordingRulesGenerator knows how to generate metadata recording rules.
type Request ¶
type Request struct { // Info about the application and execution, normally used as metadata. Info info.Info // ExtraLabels are the extra labels added to the SLOs on execution time. ExtraLabels map[string]string // SLOGroup are the SLOs group that will be used to generate the SLO results and Prom rules. SLOGroup prometheus.SLOGroup }
type SLIRecordingRulesGenerator ¶
type SLIRecordingRulesGenerator interface {
GenerateSLIRecordingRules(ctx context.Context, slo prometheus.SLO, alerts alert.MWMBAlertGroup) ([]rulefmt.Rule, error)
}
SLIRecordingRulesGenerator knows how to generate SLI recording rules.
type SLOAlertRulesGenerator ¶
type SLOAlertRulesGenerator interface {
GenerateSLOAlertRules(ctx context.Context, slo prometheus.SLO, alerts alert.MWMBAlertGroup) ([]rulefmt.Rule, error)
}
SLOAlertRulesGenerator knows hot to generate SLO alert rules.
type SLOResult ¶
type SLOResult struct { SLO prometheus.SLO Alerts alert.MWMBAlertGroup SLORules prometheus.SLORules }
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is the application service for the generation of SLO for Prometheus.
func NewService ¶
func NewService(config ServiceConfig) (*Service, error)
NewService returns a new Prometheus application service.
type ServiceConfig ¶
type ServiceConfig struct { AlertGenerator AlertGenerator SLIRecordingRulesGenerator SLIRecordingRulesGenerator MetaRecordingRulesGenerator MetadataRecordingRulesGenerator SLOAlertRulesGenerator SLOAlertRulesGenerator Validator prometheus.Validator Logger log.Logger }
ServiceConfig is the application service configuration.
Click to show internal directories.
Click to hide internal directories.