plugin

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

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

View Source
const (
	SLIPluginMetaService   = "service"
	SLIPluginMetaSLO       = "slo"
	SLIPluginMetaObjective = "objective"
)

Metada keys.

View Source
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 SLIPluginID

type SLIPluginID = string

SLIPluginID is the ID of the plugin.

type SLIPluginVersion

type SLIPluginVersion = string

SLIPluginVersion is the version of the plugin (e.g: `prometheus/v1`).

Jump to

Keyboard shortcuts

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