prometheus

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(cfg []Config, grpcServer *grpc.Server) ([]*pluginsProto.PluginShort, error)

Types

type Config

type Config struct {
	Name        string `yaml:"name"`
	Description string `yaml:"description"`
	Address     string `yaml:"address"`
	Username    string `yaml:"username"`
	Password    string `yaml:"password"`
	Token       string `yaml:"token"`
}

type Instance

type Instance struct {
	// contains filtered or unexported fields
}

type Prometheus

type Prometheus struct {
	prometheusProto.UnimplementedPrometheusServer
	// contains filtered or unexported fields
}

func (*Prometheus) GetMetrics

GetMetrics returns all metrics for all given queries. For that we are creating a map of with the selected values for all variables. Then we are looping through the list of variables, replacing the variables with the selected value and run the PromQL against the configured Prometheus instance. In the last step we transform the result, so that it can be used in the React UI.

func (*Prometheus) GetVariables

GetVariables returns all variable values. The values are label values for a Prometheus time series. The labels are retrieved via a PromQL query. To get the values we are looping over all queries and pre selecting the first value or all values, when the option is set. So we can use a variable in a following query.

func (*Prometheus) MetricLookup added in v0.2.0

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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