promapi

package
v0.28.6 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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 AbsoluteRange added in v0.22.1

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

func NewAbsoluteRange added in v0.22.1

func NewAbsoluteRange(start, end time.Time, step time.Duration) AbsoluteRange

func (AbsoluteRange) Dur added in v0.22.1

func (ar AbsoluteRange) Dur() time.Duration

func (AbsoluteRange) End added in v0.22.1

func (ar AbsoluteRange) End() time.Time

func (AbsoluteRange) Start added in v0.22.1

func (ar AbsoluteRange) Start() time.Time

func (AbsoluteRange) Step added in v0.22.1

func (ar AbsoluteRange) Step() time.Duration

func (AbsoluteRange) String added in v0.22.1

func (ar AbsoluteRange) String() string

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) CleanCache added in v0.28.4

func (fg *FailoverGroup) CleanCache()

func (*FailoverGroup) Close added in v0.22.0

func (fg *FailoverGroup) Close()

func (*FailoverGroup) Config added in v0.13.0

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

func (*FailoverGroup) Flags added in v0.26.0

func (fg *FailoverGroup) Flags(ctx context.Context) (flags *FlagsResult, err error)

func (*FailoverGroup) Metadata added in v0.21.0

func (fg *FailoverGroup) Metadata(ctx context.Context, metric string) (metadata *MetadataResult, 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, params RangeQueryTimes) (rqr *RangeQueryResult, err error)

func (*FailoverGroup) StartWorkers added in v0.22.0

func (fg *FailoverGroup) StartWorkers()

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 FlagsResult added in v0.26.0

type FlagsResult struct {
	URI   string
	Flags v1.FlagsResult
}

type MetadataResult added in v0.21.0

type MetadataResult struct {
	URI      string
	Metadata []v1.Metadata
}

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, concurrency, cacheSize, rl int) *Prometheus

func (*Prometheus) Close added in v0.22.0

func (prom *Prometheus) Close()

func (*Prometheus) Config added in v0.7.0

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

func (*Prometheus) Flags added in v0.26.0

func (p *Prometheus) Flags(ctx context.Context) (*FlagsResult, error)

func (*Prometheus) Metadata added in v0.21.0

func (p *Prometheus) Metadata(ctx context.Context, metric string) (*MetadataResult, 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, params RangeQueryTimes) (*RangeQueryResult, error)

func (*Prometheus) StartWorkers added in v0.22.0

func (prom *Prometheus) StartWorkers()

type PrometheusConfig

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

type QueryError added in v0.22.0

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

func (QueryError) Error added in v0.22.0

func (qe QueryError) Error() string

func (QueryError) Unwrap added in v0.22.0

func (qe QueryError) Unwrap() error

type QueryResult

type QueryResult struct {
	URI    string
	Series model.Vector
}

type RangeQueryResult

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

type RangeQueryTimes added in v0.22.1

type RangeQueryTimes interface {
	Start() time.Time
	End() time.Time
	Dur() time.Duration
	Step() time.Duration
	String() string
}

type RelativeRange added in v0.22.1

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

func NewRelativeRange added in v0.22.1

func NewRelativeRange(lookback, step time.Duration) RelativeRange

func (RelativeRange) Dur added in v0.22.1

func (rr RelativeRange) Dur() time.Duration

func (RelativeRange) End added in v0.22.1

func (rr RelativeRange) End() time.Time

func (RelativeRange) Start added in v0.22.1

func (rr RelativeRange) Start() time.Time

func (RelativeRange) Step added in v0.22.1

func (rr RelativeRange) Step() time.Duration

func (RelativeRange) String added in v0.22.1

func (rr RelativeRange) String() string

Jump to

Keyboard shortcuts

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