Documentation
¶
Index ¶
- Variables
- type IOWriterK8sObjectYAMLRepo
- type K8sSlothPrometheusCRSpecLoader
- type K8sSlothPrometheusYAMLSpecLoader
- func (l K8sSlothPrometheusYAMLSpecLoader) IsSpecType(ctx context.Context, data []byte) bool
- func (l K8sSlothPrometheusYAMLSpecLoader) LoadAPI(ctx context.Context, data []byte) (*k8sprometheusv1.PrometheusServiceLevel, error)
- func (l K8sSlothPrometheusYAMLSpecLoader) LoadSpec(ctx context.Context, data []byte) (*model.PromSLOGroup, error)
- func (l K8sSlothPrometheusYAMLSpecLoader) MapSpecToModel(ctx context.Context, kspec k8sprometheusv1.PrometheusServiceLevel) (*model.PromSLOGroup, error)
- type OpenSLOYAMLSpecLoader
- func (l OpenSLOYAMLSpecLoader) IsSpecType(ctx context.Context, data []byte) bool
- func (l OpenSLOYAMLSpecLoader) LoadAPI(ctx context.Context, data []byte) (*openslov1alpha.SLO, error)
- func (l OpenSLOYAMLSpecLoader) LoadSpec(ctx context.Context, data []byte) (*model.PromSLOGroup, error)
- func (l OpenSLOYAMLSpecLoader) MapSpecToModel(spec openslov1alpha.SLO) (*model.PromSLOGroup, error)
- type SLIPluginRepo
- type SlothPrometheusYAMLSpecLoader
- func (l SlothPrometheusYAMLSpecLoader) IsSpecType(ctx context.Context, data []byte) bool
- func (l SlothPrometheusYAMLSpecLoader) LoadAPI(ctx context.Context, data []byte) (*prometheusv1.Spec, error)
- func (l SlothPrometheusYAMLSpecLoader) LoadSpec(ctx context.Context, data []byte) (*model.PromSLOGroup, error)
- func (l SlothPrometheusYAMLSpecLoader) MapSpecToModel(ctx context.Context, spec prometheusv1.Spec) (*model.PromSLOGroup, error)
- type StdPrometheusGroupedRulesYAMLRepo
- type StdPrometheusStorageSLO
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNoSLORules will be used when there are no rules to store. The upper layer // could ignore or handle the error in cases where there wasn't an output. ErrNoSLORules = fmt.Errorf("0 SLO Prometheus rules generated") )
Functions ¶
This section is empty.
Types ¶
type IOWriterK8sObjectYAMLRepo ¶ added in v0.16.0
type IOWriterK8sObjectYAMLRepo struct {
// contains filtered or unexported fields
}
IOWriterK8sObjectYAMLRepo knows to store all the SLO rules (recordings and alerts) grouped in an IOWriter in Kubernetes K8sObject YAML format.
func NewIOWriterK8sObjectYAMLRepo ¶ added in v0.16.0
func NewIOWriterK8sObjectYAMLRepo(writer io.Writer, transformer plugink8stransformv1.Plugin, logger log.Logger) IOWriterK8sObjectYAMLRepo
func (IOWriterK8sObjectYAMLRepo) StoreSLOs ¶ added in v0.16.0
func (i IOWriterK8sObjectYAMLRepo) StoreSLOs(ctx context.Context, kmeta model.K8sMeta, slos model.PromSLOGroupResult) error
type K8sSlothPrometheusCRSpecLoader ¶
type K8sSlothPrometheusCRSpecLoader struct {
// contains filtered or unexported fields
}
func NewK8sSlothPrometheusCRSpecLoader ¶
func NewK8sSlothPrometheusCRSpecLoader(pluginsRepo SLIPluginRepo, windowPeriod time.Duration) K8sSlothPrometheusCRSpecLoader
NewK8sSlothPrometheusCRSpecLoader knows how to load Kubernetes CRD specs and converts them to a model.
func (K8sSlothPrometheusCRSpecLoader) LoadSpec ¶
func (c K8sSlothPrometheusCRSpecLoader) LoadSpec(ctx context.Context, spec *k8sprometheusv1.PrometheusServiceLevel) (*model.PromSLOGroup, error)
type K8sSlothPrometheusYAMLSpecLoader ¶
type K8sSlothPrometheusYAMLSpecLoader struct {
// contains filtered or unexported fields
}
K8sSlothPrometheusYAMLSpecLoader knows how to load Kubernetes ServiceLevel YAML specs and converts them to a model.
func NewK8sSlothPrometheusYAMLSpecLoader ¶
func NewK8sSlothPrometheusYAMLSpecLoader(pluginsRepo SLIPluginRepo, windowPeriod time.Duration) K8sSlothPrometheusYAMLSpecLoader
NewK8sSlothPrometheusYAMLSpecLoader returns a YAML spec loader.
func (K8sSlothPrometheusYAMLSpecLoader) IsSpecType ¶
func (l K8sSlothPrometheusYAMLSpecLoader) IsSpecType(ctx context.Context, data []byte) bool
func (K8sSlothPrometheusYAMLSpecLoader) LoadAPI ¶ added in v0.15.0
func (l K8sSlothPrometheusYAMLSpecLoader) LoadAPI(ctx context.Context, data []byte) (*k8sprometheusv1.PrometheusServiceLevel, error)
func (K8sSlothPrometheusYAMLSpecLoader) LoadSpec ¶
func (l K8sSlothPrometheusYAMLSpecLoader) LoadSpec(ctx context.Context, data []byte) (*model.PromSLOGroup, error)
func (K8sSlothPrometheusYAMLSpecLoader) MapSpecToModel ¶ added in v0.15.0
func (l K8sSlothPrometheusYAMLSpecLoader) MapSpecToModel(ctx context.Context, kspec k8sprometheusv1.PrometheusServiceLevel) (*model.PromSLOGroup, error)
type OpenSLOYAMLSpecLoader ¶
type OpenSLOYAMLSpecLoader struct {
// contains filtered or unexported fields
}
func NewOpenSLOYAMLSpecLoader ¶
func NewOpenSLOYAMLSpecLoader(windowPeriod time.Duration) OpenSLOYAMLSpecLoader
NewOpenSLOYAMLSpecLoader knows how to load OpenSLO YAML specs and converts them to a model.
func (OpenSLOYAMLSpecLoader) IsSpecType ¶
func (l OpenSLOYAMLSpecLoader) IsSpecType(ctx context.Context, data []byte) bool
func (OpenSLOYAMLSpecLoader) LoadAPI ¶ added in v0.15.0
func (l OpenSLOYAMLSpecLoader) LoadAPI(ctx context.Context, data []byte) (*openslov1alpha.SLO, error)
func (OpenSLOYAMLSpecLoader) LoadSpec ¶
func (l OpenSLOYAMLSpecLoader) LoadSpec(ctx context.Context, data []byte) (*model.PromSLOGroup, error)
func (OpenSLOYAMLSpecLoader) MapSpecToModel ¶ added in v0.15.0
func (l OpenSLOYAMLSpecLoader) MapSpecToModel(spec openslov1alpha.SLO) (*model.PromSLOGroup, error)
type SLIPluginRepo ¶
type SlothPrometheusYAMLSpecLoader ¶
type SlothPrometheusYAMLSpecLoader struct {
// contains filtered or unexported fields
}
SlothPrometheusYAMLSpecLoader knows how to load sloth prometheus YAML specs and converts them to a model.
func NewSlothPrometheusYAMLSpecLoader ¶
func NewSlothPrometheusYAMLSpecLoader(pluginsRepo SLIPluginRepo, windowPeriod time.Duration) SlothPrometheusYAMLSpecLoader
NewSlothPrometheusYAMLSpecLoader returns a YAML spec loader.
func (SlothPrometheusYAMLSpecLoader) IsSpecType ¶
func (l SlothPrometheusYAMLSpecLoader) IsSpecType(ctx context.Context, data []byte) bool
func (SlothPrometheusYAMLSpecLoader) LoadAPI ¶ added in v0.15.0
func (l SlothPrometheusYAMLSpecLoader) LoadAPI(ctx context.Context, data []byte) (*prometheusv1.Spec, error)
func (SlothPrometheusYAMLSpecLoader) LoadSpec ¶
func (l SlothPrometheusYAMLSpecLoader) LoadSpec(ctx context.Context, data []byte) (*model.PromSLOGroup, error)
func (SlothPrometheusYAMLSpecLoader) MapSpecToModel ¶ added in v0.15.0
func (l SlothPrometheusYAMLSpecLoader) MapSpecToModel(ctx context.Context, spec prometheusv1.Spec) (*model.PromSLOGroup, error)
type StdPrometheusGroupedRulesYAMLRepo ¶
type StdPrometheusGroupedRulesYAMLRepo struct {
// contains filtered or unexported fields
}
StdPrometheusGroupedRulesYAMLRepo knows to store all the SLO rules (recordings and alerts) grouped in an IOWriter in YAML format, that is compatible with Prometheus.
func NewStdPrometheusGroupedRulesYAMLRepo ¶
func NewStdPrometheusGroupedRulesYAMLRepo(writer io.Writer, logger log.Logger) StdPrometheusGroupedRulesYAMLRepo
func (StdPrometheusGroupedRulesYAMLRepo) StoreSLOs ¶
func (r StdPrometheusGroupedRulesYAMLRepo) StoreSLOs(ctx context.Context, slos model.PromSLOGroupResult) error
StoreSLOs will store the recording and alert prometheus rules, if grouped is false it will split and store as 2 different groups the alerts and the recordings, if true it will be save as a single group.
type StdPrometheusStorageSLO ¶
type StdPrometheusStorageSLO struct {
SLO model.PromSLO
Rules model.PromSLORules
}