prometheus

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDataFetcher

func NewDataFetcher(options ...Option) (datafetcher.Interface, error)

NewDataFetcher constructs a DataFetcher instance by applying all the provided options. Returns error if any one of the options fails.

Types

type DataFetcher

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

DataFetcher implements datafetcher.Interface and is used to fetch time series data from the given prometheus endpoint.

func (*DataFetcher) Fetch

func (f *DataFetcher) Fetch() (result model.Value, err error)

Fetch the data from prometheus, filter it using the provided labels, matching operations and corresponding values and return the result. Time series is fetched using the v1 API. Note that v1 API is still in experimental stage and therefore we need to watch out for compatibility issues.

func (*DataFetcher) GetEndpoint

func (f *DataFetcher) GetEndpoint() string

GetEndpoint returns the prometheus HTTP server endpoint.

func (*DataFetcher) SetStrategy

func (f *DataFetcher) SetStrategy(s strategies.Interface)

SetStrategy sets the task ranking strategy and instantiates the query builder.

type Option

type Option func(f *DataFetcher) error

func WithPrometheusEndpoint

func WithPrometheusEndpoint(endpoint string) Option

WithPrometheusEndpoint returns an option that initializes the prometheus HTTP server endpoint.

Jump to

Keyboard shortcuts

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