Documentation ¶
Index ¶
- func Register(cfg []Config, grpcServer *grpc.Server) ([]*pluginsProto.PluginShort, error)
- type Config
- type Instance
- type Prometheus
- func (p *Prometheus) GetMetrics(ctx context.Context, getMetricsRequest *prometheusProto.GetMetricsRequest) (*prometheusProto.GetMetricsResponse, error)
- func (p *Prometheus) GetVariables(ctx context.Context, getVariablesRequest *prometheusProto.GetVariablesRequest) (*prometheusProto.GetVariablesResponse, error)
- func (p *Prometheus) MetricLookup(ctx context.Context, metricsLookupRequest *prometheusProto.MetricLookupRequest) (*prometheusProto.MetricLookupResponse, error)
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 Prometheus ¶
type Prometheus struct { prometheusProto.UnimplementedPrometheusServer // contains filtered or unexported fields }
func (*Prometheus) GetMetrics ¶
func (p *Prometheus) GetMetrics(ctx context.Context, getMetricsRequest *prometheusProto.GetMetricsRequest) (*prometheusProto.GetMetricsResponse, error)
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 ¶
func (p *Prometheus) GetVariables(ctx context.Context, getVariablesRequest *prometheusProto.GetVariablesRequest) (*prometheusProto.GetVariablesResponse, error)
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
func (p *Prometheus) MetricLookup(ctx context.Context, metricsLookupRequest *prometheusProto.MetricLookupRequest) (*prometheusProto.MetricLookupResponse, error)