plugins

package
v0.0.0-...-09e306e Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2025 License: Apache-2.0 Imports: 3 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]
	// Database connection.
	DB db.DB
}

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, 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, 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