prometheus

package
v0.3.0-alpha Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API interface {
	Query(ctx context.Context, query string, ts time.Time) (model.Value, apiv1.Warnings, error)
}

API is a subset of Prometheus API interface. https://github.com/prometheus/client_golang/blob/803ef2a759d7caaaa0de58e3815f1be4c8b5a42a/api/prometheus/v1/api.go#L218-L251 This subset allows us to implement in our tests only the functions we use, while allowing compatibility with Prometheus API interface.

type Configuration

type Configuration struct {
	PrometheusURL                 string
	MetricsUpdateIntervalInMS     int
	HealthcheckUpdateIntervalInMS int
}

type Helper

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

func NewHelper

func NewHelper(prometheusURL string) (*Helper, error)

NewHelper creates a helper with the standard Prometheus client and API inside it, encapsulating all Prometheus dependencies.

func (*Helper) VectorFirst

func (p *Helper) VectorFirst(query string) (float64, error)

type Query

type Query struct {
	Description string
	Query       string
	Threshold   float64
	Alert       bool
}

Jump to

Keyboard shortcuts

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