Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
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.
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.