prometheus

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: May 30, 2020 License: Apache-2.0, BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	// Metadata returns the first occurrence of metadata about metrics currently scraped by the metric name.
	Metadata(ctx context.Context, metric string) (v1.Metadata, error)
	// AllMetadata returns metadata about metrics currently scraped for all existing metrics.
	AllMetadata(ctx context.Context) (map[string][]v1.Metadata, error)
	// LabelNames returns all the unique label names present in the block in sorted order.
	// If a metric is provided, then it will return all unique label names linked to the metric during a predefined period of time
	LabelNames(ctx context.Context, metricName string) ([]string, error)
	// LabelValues performs a query for the values of the given label.
	LabelValues(ctx context.Context, label string) ([]model.LabelValue, error)
	// ChangeDataSource is used if the prometheusURL is changing.
	// The client should re init its own parameter accordingly if necessary
	ChangeDataSource(prometheusURL string) error
	// GetURL is returning the url used to contact the prometheus server
	// In case the instance is used directly in Prometheus, it should be the externalURL
	GetURL() string
}

Client is a light prometheus client used by LSP to get data from a a prometheus Server.

func NewClient

func NewClient(prometheusURL string) (Client, error)

Jump to

Keyboard shortcuts

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