Versions in this module Expand all Collapse all v0 v0.11.0 Jun 3, 2022 Changes in this version + const MetadataRecordingRulesGenerator + var ErrNoSLORules = fmt.Errorf("0 SLO Prometheus rules generated") + var OptimizedSLIRecordingRulesGenerator = sliRecordingRulesGenerator + var SLIRecordingRulesGenerator = sliRecordingRulesGenerator + var SLOAlertRulesGenerator = sloAlertRulesGenerator + func MergeLabels(ms ...map[string]string) map[string]string + type AlertMeta struct + Annotations map[string]string + Disable bool + Labels map[string]string + Name string + type FileManager interface + FindFiles func(ctx context.Context, root string, matcher *regexp.Regexp) (paths []string, err error) + ReadFile func(ctx context.Context, path string) (data []byte, err error) + type FileSLIPluginRepo struct + func NewFileSLIPluginRepo(config FileSLIPluginRepoConfig) (*FileSLIPluginRepo, error) + func (f *FileSLIPluginRepo) GetSLIPlugin(ctx context.Context, id string) (*SLIPlugin, error) + func (f *FileSLIPluginRepo) ListSLIPlugins(ctx context.Context) (map[string]SLIPlugin, error) + func (f *FileSLIPluginRepo) Reload(ctx context.Context) error + type FileSLIPluginRepoConfig struct + FileManager FileManager + Logger log.Logger + Paths []string + type IOWriterGroupedRulesYAMLRepo struct + func NewIOWriterGroupedRulesYAMLRepo(writer io.Writer, logger log.Logger) IOWriterGroupedRulesYAMLRepo + func (i IOWriterGroupedRulesYAMLRepo) StoreSLOs(ctx context.Context, slos []StorageSLO) error + type SLI struct + Events *SLIEvents + Raw *SLIRaw + type SLIEvents struct + ErrorQuery string + TotalQuery string + type SLIPlugin struct + Func plugin.SLIPlugin + ID string + type SLIPluginRepo interface + GetSLIPlugin func(ctx context.Context, id string) (*SLIPlugin, error) + type SLIRaw struct + ErrorRatioQuery string + type SLO struct + Description string + ID string + Labels map[string]string + Name string + Objective float64 + PageAlertMeta AlertMeta + SLI SLI + Service string + TicketAlertMeta AlertMeta + TimeWindow time.Duration + func (s SLO) GetSLIErrorMetric(window time.Duration) string + func (s SLO) GetSLOIDPromLabels() map[string]string + type SLOGroup struct + SLOs []SLO + func (s SLOGroup) Validate() error + type SLORules struct + AlertRules []rulefmt.Rule + MetadataRecRules []rulefmt.Rule + SLIErrorRecRules []rulefmt.Rule + type StorageSLO struct + Rules SLORules + SLO SLO + type YAMLSpecLoader struct + func NewYAMLSpecLoader(pluginsRepo SLIPluginRepo, windowPeriod time.Duration) YAMLSpecLoader + func (y YAMLSpecLoader) IsSpecType(ctx context.Context, data []byte) bool + func (y YAMLSpecLoader) LoadSpec(ctx context.Context, data []byte) (*SLOGroup, error)