prometheus

package
v0.49.3 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Prometheus

type Prometheus struct {
	prometheus.Client
}

func NewPrometheus

func NewPrometheus() (*Prometheus, error)

func (*Prometheus) CanHandleSelector

func (p *Prometheus) CanHandleSelector(labels entities.Selector) bool

CanHandleSelector returns true only if both prometheus query/url are defined

func (*Prometheus) ComputeObjective

func (p *Prometheus) ComputeObjective(o *entities.Objective, from time.Time, to time.Time) (*entities.Indicator, error)

func (*Prometheus) ComputeSloFromPrometheusQuery added in v0.42.1

func (p *Prometheus) ComputeSloFromPrometheusQuery(query string, from time.Time, to time.Time) (float64, error)

func (*Prometheus) ResourceFromSelector

func (prom *Prometheus) ResourceFromSelector(labels entities.Selector) string

No resource identifier can be found, this is part of prom env vars as we are running queries to Prometheus api

func (*Prometheus) RunPrometheusQuery added in v0.42.1

func (p *Prometheus) RunPrometheusQuery(query string, from time.Time, to time.Time) (model.Value, error)

type PrometheusAPI

type PrometheusAPI interface {
	RunPrometheusQuery(query string, url string, from time.Time, to time.Time) (model.Value, error)
	ComputeSloFromPrometheusQuery(query string, url string, from time.Time, to time.Time) (float64, error)
}

Jump to

Keyboard shortcuts

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