prometheus

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2023 License: Apache-2.0 Imports: 10 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Aggregation

type Aggregation string
const (
	Avg   Aggregation = "avg"
	Max   Aggregation = "max"
	Min   Aggregation = "min"
	P99   Aggregation = "99"
	P95   Aggregation = "95"
	P90   Aggregation = "90"
	P50   Aggregation = "50"
	Stdev Aggregation = "stdev"
)

type Prometheus

type Prometheus struct {
	Endpoint string
	// contains filtered or unexported fields
}

Prometheus describes the prometheus connection

func NewClient

func NewClient(url, token, username, password string, tlsSkipVerify bool) (*Prometheus, error)

NewClient creates a prometheus struct instance with the given parameters

func (*Prometheus) Query

func (p *Prometheus) Query(query string, time time.Time) (model.Value, error)

Query prometheus query wrapper

func (*Prometheus) QueryRange

func (p *Prometheus) QueryRange(query string, start, end time.Time, step time.Duration) (model.Value, error)

QueryRange prometheus queryRange wrapper

func (*Prometheus) QueryRangeAggregatedTS

func (p *Prometheus) QueryRangeAggregatedTS(query string, start, end time.Time, step time.Duration, aggregation Aggregation) (float64, error)

QueryRangeAggregation returns the aggregation from the given query if the query returns multiple timeseries, their data points are aggregated into a single one

Jump to

Keyboard shortcuts

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