v1

package
v0.12.1-0...-6bdb67e Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const PluginFactoryName = "NewPlugin"

PluginFactoryName is the required name for the plugin factory.

View Source
const PluginIDName = "PluginID"
View Source
const PluginVersionName = "PluginVersion"
View Source
const Version = "prometheus/slo/v1"

Version is this plugin type version.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppUtils

type AppUtils struct {
	Logger log.Logger
}

AppUtils are app utils plugins can use in their logic.

type Plugin

type Plugin interface {
	ProcessSLO(ctx context.Context, request *Request, result *Result) error
}

Plugin knows how to process SLOs in a chain of plugins. * The plugin processor can change the result argument of the SLO processing with the resulting prometheus rules. * The plugin processor can also modify the request object, but this is not recommended as it can lead to unexpected behavior.

This is the type the SLO plugins need to implement.

type PluginFactory

type PluginFactory = func(config json.RawMessage, appUtils AppUtils) (Plugin, error)

type PluginID

type PluginID = string

PluginID is the ID of the plugin (e.g: sloth.dev/my-test-plugin/v1).

type PluginVersion

type PluginVersion = string

PluginVersion is the version of the plugin (e.g: `prometheus/slo/v1`).

type Request

type Request struct {
	// Info about the application and execution, normally used as metadata.
	Info model.Info
	// OriginalSource is the original specification of the SLO came from, this is informative data that
	// can be used to make decision on plugins, it should be used only as RO.
	// The information used on the generation is the SLO model itself not this one.
	OriginalSource model.PromSLOGroupSource
	// The SLO to process and generate the final Prom rules.
	SLO model.PromSLO
	// The SLO MWMBAlertGroup selected.
	MWMBAlertGroup model.MWMBAlertGroup
}

type Result

type Result struct {
	SLORules model.PromSLORules
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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