Documentation ¶
Index ¶
- func NewPrometheusClient(config *PromConfig) (prometheusapi.Client, error)
- type MockPromAPIClient
- func (m *MockPromAPIClient) AlertManagers(ctx context.Context) (v1.AlertManagersResult, error)
- func (m *MockPromAPIClient) Alerts(ctx context.Context) (v1.AlertsResult, error)
- func (m *MockPromAPIClient) Buildinfo(ctx context.Context) (v1.BuildinfoResult, error)
- func (m *MockPromAPIClient) CleanTombstones(ctx context.Context) error
- func (m *MockPromAPIClient) Config(ctx context.Context) (v1.ConfigResult, error)
- func (m *MockPromAPIClient) DeleteSeries(ctx context.Context, matches []string, startTime time.Time, endTime time.Time) error
- func (m *MockPromAPIClient) Flags(ctx context.Context) (v1.FlagsResult, error)
- func (m *MockPromAPIClient) LabelNames(ctx context.Context, matches []string, startTime time.Time, endTime time.Time) ([]string, v1.Warnings, error)
- func (m *MockPromAPIClient) LabelValues(ctx context.Context, label string, matches []string, startTime time.Time, ...) (model.LabelValues, v1.Warnings, error)
- func (m *MockPromAPIClient) Metadata(ctx context.Context, metric string, limit string) (map[string][]v1.Metadata, error)
- func (m *MockPromAPIClient) Query(ctx context.Context, query string, ts time.Time, opts ...v1.Option) (model.Value, v1.Warnings, error)
- func (m *MockPromAPIClient) QueryExemplars(ctx context.Context, query string, startTime time.Time, endTime time.Time) ([]v1.ExemplarQueryResult, error)
- func (m *MockPromAPIClient) QueryRange(ctx context.Context, query string, r v1.Range, opts ...v1.Option) (model.Value, v1.Warnings, error)
- func (m *MockPromAPIClient) Rules(ctx context.Context) (v1.RulesResult, error)
- func (m *MockPromAPIClient) Runtimeinfo(ctx context.Context) (v1.RuntimeinfoResult, error)
- func (m *MockPromAPIClient) Series(ctx context.Context, matches []string, startTime time.Time, endTime time.Time) ([]model.LabelSet, v1.Warnings, error)
- func (m *MockPromAPIClient) Snapshot(ctx context.Context, skipHead bool) (v1.SnapshotResult, error)
- func (m *MockPromAPIClient) TSDB(ctx context.Context) (v1.TSDBResult, error)
- func (m *MockPromAPIClient) Targets(ctx context.Context) (v1.TargetsResult, error)
- func (m *MockPromAPIClient) TargetsMetadata(ctx context.Context, matchTarget string, metric string, limit string) ([]v1.MetricMetadata, error)
- func (m *MockPromAPIClient) WalReplay(ctx context.Context) (v1.WalReplayStatus, error)
- type PromConfig
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 (m *MockPromAPIClient) Alerts(ctx context.Context) (v1.AlertsResult, error)
func (*MockPromAPIClient) Buildinfo ¶
func (m *MockPromAPIClient) Buildinfo(ctx context.Context) (v1.BuildinfoResult, error)
func (*MockPromAPIClient) CleanTombstones ¶
func (m *MockPromAPIClient) CleanTombstones(ctx context.Context) error
func (*MockPromAPIClient) Config ¶
func (m *MockPromAPIClient) Config(ctx context.Context) (v1.ConfigResult, error)
func (*MockPromAPIClient) DeleteSeries ¶
func (*MockPromAPIClient) Flags ¶
func (m *MockPromAPIClient) Flags(ctx context.Context) (v1.FlagsResult, error)
func (*MockPromAPIClient) LabelNames ¶
func (*MockPromAPIClient) LabelValues ¶
func (*MockPromAPIClient) QueryExemplars ¶
func (*MockPromAPIClient) QueryRange ¶
func (*MockPromAPIClient) Rules ¶
func (m *MockPromAPIClient) Rules(ctx context.Context) (v1.RulesResult, error)
func (*MockPromAPIClient) Runtimeinfo ¶
func (m *MockPromAPIClient) Runtimeinfo(ctx context.Context) (v1.RuntimeinfoResult, error)
func (*MockPromAPIClient) Snapshot ¶
func (m *MockPromAPIClient) Snapshot(ctx context.Context, skipHead bool) (v1.SnapshotResult, error)
func (*MockPromAPIClient) TSDB ¶
func (m *MockPromAPIClient) TSDB(ctx context.Context) (v1.TSDBResult, error)
func (*MockPromAPIClient) Targets ¶
func (m *MockPromAPIClient) Targets(ctx context.Context) (v1.TargetsResult, error)
func (*MockPromAPIClient) TargetsMetadata ¶
func (m *MockPromAPIClient) TargetsMetadata(ctx context.Context, matchTarget string, metric string, limit string) ([]v1.MetricMetadata, error)
func (*MockPromAPIClient) WalReplay ¶
func (m *MockPromAPIClient) WalReplay(ctx context.Context) (v1.WalReplayStatus, error)
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
Click to show internal directories.
Click to hide internal directories.