Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Factory ¶
type Factory interface { // GetGetStrategy returns a output based on the SLO source. GetStrategy(*monitoringv1alpha1.SLO) (Output, error) }
Factory is a factory that knows how to get the correct Output strategy based on the SLO output source.
func NewFactory ¶
NewFactory returns a new output factory.
type MockFactory ¶
type MockFactory struct {
Mock Output
}
MockFactory returns the mocked output strategy.
func (MockFactory) GetStrategy ¶
func (m MockFactory) GetStrategy(_ *monitoringv1alpha1.SLO) (Output, error)
GetStrategy satisfies Factory interface.
type Output ¶
type Output interface { // Create will create the SLI result and the SLO on the specific format. // It receives the SLI's SLO and it's result. Create(serviceLevel *monitoringv1alpha1.ServiceLevel, slo *monitoringv1alpha1.SLO, result *sli.Result) error }
Output knows how expose/send/create the output of a SLO and SLI result.
func NewLogger ¶
NewLogger returns a new output logger service that will output the SLOs on the specified logger.
func NewMetricsMiddleware ¶
NewMetricsMiddleware returns a new metrics middleware that wraps a Output SLO service and monitorings with metrics.
func NewPrometheus ¶
func NewPrometheus(cfg PrometheusCfg, reg prometheus.Registerer, logger log.Logger) Output
NewPrometheus returns a new Prometheus output.
type PrometheusCfg ¶
type PrometheusCfg struct { // ExpireDuration is the time a metric will expire if is not refreshed. ExpireDuration time.Duration }
PrometheusCfg is the configuration of the Prometheus Output.
func (*PrometheusCfg) Validate ¶
func (p *PrometheusCfg) Validate()
Validate will validate the cfg setting safe defaults.