plugins

package
v0.0.0-...-eed02e1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseKPI

type BaseKPI[Opts any] struct {
	// Options to pass via json to this step.
	conf.JsonOpts[Opts]
	// (Optional) database connection where datasources are stored.
	DB *db.DB
	// Kubernetes client to access other resources.
	Client client.Client
}

Common base for all KPIs that provides some functionality that would otherwise be duplicated across all KPIs.

func (*BaseKPI[Opts]) Init

func (k *BaseKPI[Opts]) Init(db *db.DB, client client.Client, opts conf.RawOpts) error

Init the KPI with the database, options, and the registry to publish metrics on.

type KPI

type KPI interface {
	// Configure the kpi with a database, options, and the
	// registry to publish metrics on.
	Init(db *db.DB, client client.Client, opts conf.RawOpts) error
	// Collect the kpi from the given data.
	Collect(ch chan<- prometheus.Metric)
	// Describe this metric.
	Describe(ch chan<- *prometheus.Desc)
	// Get the name of this kpi.
	// This name is used to identify the kpi in metrics, config, logs, etc.
	// Should be something like: "my_cool_kpi".
	GetName() string
}

Each kpi plugin must conform to this interface.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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