io

package
v0.16.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 4, 2026 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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

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

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 (K8sSlothPrometheusYAMLSpecLoader) LoadSpec

func (K8sSlothPrometheusYAMLSpecLoader) MapSpecToModel added in v0.15.0

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 SLIPluginRepo interface {
	GetSLIPlugin(ctx context.Context, id string) (*pluginenginesli.SLIPlugin, error)
}

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 (SlothPrometheusYAMLSpecLoader) LoadSpec

func (SlothPrometheusYAMLSpecLoader) MapSpecToModel added in v0.15.0

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

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
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL