Documentation ¶
Index ¶
- type Aggregation
- type Prometheus
- func (p *Prometheus) Query(query string, time time.Time) (model.Value, error)
- func (p *Prometheus) QueryRange(query string, start, end time.Time, step time.Duration) (model.Value, error)
- func (p *Prometheus) QueryRangeAggregatedTS(query string, start, end time.Time, step time.Duration, ...) (float64, error)
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) 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
Click to show internal directories.
Click to hide internal directories.