promapi

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CanRetryError added in v0.13.0

func CanRetryError(err error, delta time.Duration) (time.Duration, bool)

func IsUnavailableError added in v0.13.0

func IsUnavailableError(err error) bool

func RegisterMetrics added in v0.11.0

func RegisterMetrics()

Types

type APIError added in v0.15.2

type APIError struct {
	Status    string       `json:"status"`
	ErrorType v1.ErrorType `json:"errorType"`
	Error     string       `json:"error"`
}

type ConfigResult added in v0.14.0

type ConfigResult struct {
	URI    string
	Config PrometheusConfig
}

type ConfigSectionGlobal

type ConfigSectionGlobal struct {
	ScrapeInterval     time.Duration     `yaml:"scrape_interval"`
	ScrapeTimeout      time.Duration     `yaml:"scrape_timeout"`
	EvaluationInterval time.Duration     `yaml:"evaluation_interval"`
	ExternalLabels     map[string]string `yaml:"external_labels"`
}

type FailoverGroup added in v0.13.0

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

func NewFailoverGroup added in v0.13.0

func NewFailoverGroup(name string, servers []*Prometheus, strictErrors bool) *FailoverGroup

func (*FailoverGroup) ClearCache added in v0.13.0

func (fg *FailoverGroup) ClearCache()

func (*FailoverGroup) Config added in v0.13.0

func (fg *FailoverGroup) Config(ctx context.Context) (cfg *ConfigResult, err error)

func (*FailoverGroup) Name added in v0.13.0

func (fg *FailoverGroup) Name() string

func (*FailoverGroup) Query added in v0.13.0

func (fg *FailoverGroup) Query(ctx context.Context, expr string) (qr *QueryResult, err error)

func (*FailoverGroup) RangeQuery added in v0.13.0

func (fg *FailoverGroup) RangeQuery(ctx context.Context, expr string, lookback, step time.Duration) (rqr *RangeQueryResult, err error)

type FailoverGroupError added in v0.14.0

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

func (*FailoverGroupError) Error added in v0.14.0

func (e *FailoverGroupError) Error() string

func (*FailoverGroupError) IsStrict added in v0.14.0

func (e *FailoverGroupError) IsStrict() bool

func (*FailoverGroupError) URI added in v0.14.0

func (e *FailoverGroupError) URI() string

func (*FailoverGroupError) Unwrap added in v0.14.0

func (e *FailoverGroupError) Unwrap() error

type Prometheus added in v0.7.0

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

func NewPrometheus added in v0.7.0

func NewPrometheus(name, uri string, timeout time.Duration) *Prometheus

func (*Prometheus) Config added in v0.7.0

func (p *Prometheus) Config(ctx context.Context) (*ConfigResult, error)

func (*Prometheus) Query added in v0.7.0

func (p *Prometheus) Query(ctx context.Context, expr string) (*QueryResult, error)

func (*Prometheus) RangeQuery added in v0.7.0

func (p *Prometheus) RangeQuery(ctx context.Context, expr string, lookback, step time.Duration) (*RangeQueryResult, error)

type PrometheusConfig

type PrometheusConfig struct {
	Global ConfigSectionGlobal `yaml:"global"`
}

type QueryResult

type QueryResult struct {
	URI             string
	Series          model.Vector
	DurationSeconds float64
}

type RangeQueryResult

type RangeQueryResult struct {
	URI             string
	Samples         []*model.SampleStream
	Start           time.Time
	End             time.Time
	DurationSeconds float64
}

Jump to

Keyboard shortcuts

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