Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
NoopPlugin, _ = NewSLOProcessorFromSLOPluginV1(plugincorenoopv1.NewPlugin, log.Noop, nil)
)
Default plugins.
Functions ¶
This section is empty.
Types ¶
type AlertGenerator ¶
type AlertGenerator interface {
GenerateMWMBAlerts(ctx context.Context, slo alert.SLO) (*model.MWMBAlertGroup, error)
}
AlertGenerator knows how to generate multiwindow multi-burn SLO alerts.
type Request ¶
type Request struct {
// Info about the application and execution, normally used as metadata.
Info model.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 model.PromSLOGroup
}
type SLOPluginGetter ¶ added in v0.13.0
type SLOProcessor ¶ added in v0.13.0
type SLOProcessor interface {
ProcessSLO(ctx context.Context, req *SLOProcessorRequest, res *SLOProcessorResult) error
}
SLOProcessor is the interface that will be used to process SLO and generate rules. This is an abstraction to be able to support multiple and different SLO plugin versions or custom internal processors.
func NewSLOProcessorFromSLOPluginV1 ¶ added in v0.13.0
func NewSLOProcessorFromSLOPluginV1(pluginFactory pluginslov1.PluginFactory, logger log.Logger, config any) (SLOProcessor, error)
NewSLOProcessorFromSLOPluginV1 will be able to map a SLO plugin v1 to the SLOProcessor interface.
type SLOProcessorFunc ¶ added in v0.13.0
type SLOProcessorFunc func(ctx context.Context, req *SLOProcessorRequest, res *SLOProcessorResult) error
SLOProcessorFunc is a helper function to create processors easily.
func (SLOProcessorFunc) ProcessSLO ¶ added in v0.13.0
func (s SLOProcessorFunc) ProcessSLO(ctx context.Context, req *SLOProcessorRequest, res *SLOProcessorResult) error
type SLOProcessorRequest ¶ added in v0.13.0
type SLOProcessorRequest struct {
Info model.Info
SLO model.PromSLO
SLOGroup model.PromSLOGroup
MWMBAlertGroup model.MWMBAlertGroup
}
type SLOProcessorResult ¶ added in v0.13.0
type SLOProcessorResult struct {
SLORules model.PromSLORules
}
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
DefaultPlugins []SLOProcessor
ExtraPlugins []model.PromSLOPluginMetadata
SLOPluginGetter SLOPluginGetter
Logger log.Logger
}
ServiceConfig is the application service configuration.
Click to show internal directories.
Click to hide internal directories.