Documentation ¶
Overview ¶
package plugin has all the API to load prometheus plugins using Yaegi. It uses aliases and common types to easy the dynamic plugin load so we don't need to import this package as a library (remove dependencies/external libs from plugins).
We use map[string]string and let the plugin make the correct conversion of types because dealing with interfaces on dynamic plugins can lead to bugs and unwanted behaviour, so we play it safe.
Index ¶
Constants ¶
const ( SLIPluginMetaService = "service" SLIPluginMetaSLO = "slo" SLIPluginMetaObjective = "objective" )
Metada keys.
const Version = "prometheus/v1"
Version is this plugin type version.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SLIPlugin ¶
type SLIPlugin = func(ctx context.Context, meta, labels, options map[string]string) (query string, err error)
SLIPlugin knows how to generate SLIs based on data options.
This is the type the SLI plugins need to implement.
type SLIPluginVersion ¶
type SLIPluginVersion = string
SLIPluginVersion is the version of the plugin (e.g: `prometheus/v1`).