prometheus

package
v0.5.6 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPrometheusClient

func NewPrometheusClient(config *PromConfig) (prometheusapi.Client, error)

NewPrometheusClient returns a prometheus.Client

Types

type MockPromAPIClient

type MockPromAPIClient struct {
	QueryRangeFunc func(ctx context.Context, query string, r v1.Range) (model.Value, v1.Warnings, error)
}

MockPromAPIClient is a mock implementation of v1.API for testing purposes.

func (*MockPromAPIClient) AlertManagers

func (m *MockPromAPIClient) AlertManagers(ctx context.Context) (v1.AlertManagersResult, error)

func (*MockPromAPIClient) Alerts

func (*MockPromAPIClient) Buildinfo

func (*MockPromAPIClient) CleanTombstones

func (m *MockPromAPIClient) CleanTombstones(ctx context.Context) error

func (*MockPromAPIClient) Config

func (*MockPromAPIClient) DeleteSeries

func (m *MockPromAPIClient) DeleteSeries(ctx context.Context, matches []string, startTime time.Time, endTime time.Time) error

func (*MockPromAPIClient) Flags

func (*MockPromAPIClient) LabelNames

func (m *MockPromAPIClient) LabelNames(ctx context.Context, matches []string, startTime time.Time, endTime time.Time) ([]string, v1.Warnings, error)

func (*MockPromAPIClient) LabelValues

func (m *MockPromAPIClient) LabelValues(ctx context.Context, label string, matches []string, startTime time.Time, endTime time.Time) (model.LabelValues, v1.Warnings, error)

func (*MockPromAPIClient) Metadata

func (m *MockPromAPIClient) Metadata(ctx context.Context, metric string, limit string) (map[string][]v1.Metadata, error)

func (*MockPromAPIClient) Query

func (m *MockPromAPIClient) Query(ctx context.Context, query string, ts time.Time, opts ...v1.Option) (model.Value, v1.Warnings, error)

func (*MockPromAPIClient) QueryExemplars

func (m *MockPromAPIClient) QueryExemplars(ctx context.Context, query string, startTime time.Time, endTime time.Time) ([]v1.ExemplarQueryResult, error)

func (*MockPromAPIClient) QueryRange

func (m *MockPromAPIClient) QueryRange(ctx context.Context, query string, r v1.Range, opts ...v1.Option) (model.Value, v1.Warnings, error)

func (*MockPromAPIClient) Rules

func (*MockPromAPIClient) Runtimeinfo

func (m *MockPromAPIClient) Runtimeinfo(ctx context.Context) (v1.RuntimeinfoResult, error)

func (*MockPromAPIClient) Series

func (m *MockPromAPIClient) Series(ctx context.Context, matches []string, startTime time.Time, endTime time.Time) ([]model.LabelSet, v1.Warnings, error)

func (*MockPromAPIClient) Snapshot

func (m *MockPromAPIClient) Snapshot(ctx context.Context, skipHead bool) (v1.SnapshotResult, error)

func (*MockPromAPIClient) TSDB

func (*MockPromAPIClient) Targets

func (*MockPromAPIClient) TargetsMetadata

func (m *MockPromAPIClient) TargetsMetadata(ctx context.Context, matchTarget string, metric string, limit string) ([]v1.MetricMetadata, error)

func (*MockPromAPIClient) WalReplay

type PromConfig

type PromConfig struct {
	Address            string
	Timeout            time.Duration
	KeepAlive          time.Duration
	InsecureSkipVerify bool
	Auth               auth.ClientAuth

	QueryConcurrency            int
	BRateLimit                  bool
	MaxPointsLimitPerTimeSeries int
	TLSHandshakeTimeoutInSecond time.Duration

	BaseFilter string
}

PromConfig represents the config of prometheus

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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