Versions in this module Expand all Collapse all v0 v0.11.0 Jun 3, 2022 Changes in this version + var ErrNoSLORules = fmt.Errorf("0 SLO Prometheus rules generated") + func MergeLabels(ms ...map[string]string) map[string]string + type CRSpecLoader struct + func NewCRSpecLoader(pluginsRepo SLIPluginRepo, windowPeriod time.Duration) CRSpecLoader + func (c CRSpecLoader) LoadSpec(ctx context.Context, spec *k8sprometheusv1.PrometheusServiceLevel) (*SLOGroup, error) + type DryRunKubernetesService struct + func NewKubernetesServiceDryRun(svc KubernetesService, logger log.Logger) DryRunKubernetesService + func (d DryRunKubernetesService) EnsurePrometheusRule(ctx context.Context, pr *monitoringv1.PrometheusRule) error + func (d DryRunKubernetesService) EnsurePrometheusServiceLevelStatus(ctx context.Context, slo *slothv1.PrometheusServiceLevel, err error) error + func (d DryRunKubernetesService) ListPrometheusServiceLevels(ctx context.Context, ns string, opts metav1.ListOptions) (*slothv1.PrometheusServiceLevelList, error) + func (d DryRunKubernetesService) WatchPrometheusServiceLevels(ctx context.Context, ns string, opts metav1.ListOptions) (watch.Interface, error) + type FakeKubernetesService struct + func NewKubernetesServiceFake(logger log.Logger) FakeKubernetesService + func (f FakeKubernetesService) EnsurePrometheusRule(ctx context.Context, pr *monitoringv1.PrometheusRule) error + func (f FakeKubernetesService) EnsurePrometheusServiceLevelStatus(ctx context.Context, slo *slothv1.PrometheusServiceLevel, err error) error + func (f FakeKubernetesService) ListPrometheusServiceLevels(ctx context.Context, ns string, opts metav1.ListOptions) (*slothv1.PrometheusServiceLevelList, error) + func (f FakeKubernetesService) WatchPrometheusServiceLevels(ctx context.Context, ns string, opts metav1.ListOptions) (watch.Interface, error) + type IOWriterPrometheusOperatorYAMLRepo struct + func NewIOWriterPrometheusOperatorYAMLRepo(writer io.Writer, logger log.Logger) IOWriterPrometheusOperatorYAMLRepo + func (i IOWriterPrometheusOperatorYAMLRepo) StoreSLOs(ctx context.Context, kmeta K8sMeta, slos []StorageSLO) error + type K8sMeta struct + APIVersion string + Annotations map[string]string + Kind string + Labels map[string]string + Name string + Namespace string + UID string + type KubernetesService struct + func NewKubernetesService(slothCli slothclientset.Interface, monitoringCli monitoringclientset.Interface, ...) KubernetesService + func (k KubernetesService) EnsurePrometheusRule(ctx context.Context, pr *monitoringv1.PrometheusRule) error + func (k KubernetesService) EnsurePrometheusServiceLevelStatus(ctx context.Context, slo *slothv1.PrometheusServiceLevel, err error) error + func (k KubernetesService) ListPrometheusServiceLevels(ctx context.Context, ns string, opts metav1.ListOptions) (*slothv1.PrometheusServiceLevelList, error) + func (k KubernetesService) WatchPrometheusServiceLevels(ctx context.Context, ns string, opts metav1.ListOptions) (watch.Interface, error) + type PrometheusOperatorCRDRepo struct + func NewPrometheusOperatorCRDRepo(ensurer PrometheusRulesEnsurer, logger log.Logger) PrometheusOperatorCRDRepo + func (p PrometheusOperatorCRDRepo) StoreSLOs(ctx context.Context, kmeta K8sMeta, slos []StorageSLO) error + type PrometheusRulesEnsurer interface + EnsurePrometheusRule func(ctx context.Context, pr *monitoringv1.PrometheusRule) error + type SLIPluginRepo interface + GetSLIPlugin func(ctx context.Context, id string) (*prometheus.SLIPlugin, error) + type SLOGroup struct + K8sMeta K8sMeta + func (s SLOGroup) Validate() error + type StorageSLO struct + Rules prometheus.SLORules + SLO prometheus.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)