prometheus

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MetadataService added in v0.6.0

type MetadataService interface {
	// MetricMetadata returns the first occurrence of metadata about metrics currently scraped by the metric name.
	MetricMetadata(ctx context.Context, metric string) (v1.Metadata, error)
	// AllMetricMetadata returns metadata about metrics currently scraped for all existing metrics.
	AllMetricMetadata(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
	// SetLookbackInterval is a method to use to change the interval that then will be used to retrieve data such as label and metrics from prometheus.
	SetLookbackInterval(interval time.Duration)
	// 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
}

MetadataService is a light prometheus client used by LSP to get metric or label information from prometheus Server.

func NewClient

func NewClient(prometheusURL string, lookbackInterval time.Duration) (MetadataService, error)

Jump to

Keyboard shortcuts

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