plugins

package
v0.0.0-...-ccb81e8 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: Apache-2.0 Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Index = map[string]func() KPI{}

Index of all supported kpis, keyed by name. Each kpi registers itself here through a func init() in its own file.

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