prometheus

package
v0.1.0-latest-stable Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2026 License: Apache-2.0 Imports: 6 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// DefaultService is the Prometheus service deployed by kube-prometheus-stack.
	DefaultService = "kube-prometheus-stack-prometheus"
	// DefaultPort is the default Prometheus HTTP port.
	DefaultPort = 9090
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client queries Prometheus via the Kubernetes API server service proxy.

func NewClient

func NewClient(restClient *rest.RESTClient, namespace string) *Client

NewClient returns a Client that proxies through the kube-prometheus-stack Prometheus service in the given namespace.

func (*Client) QueryInstant

func (c *Client) QueryInstant(ctx context.Context, query string) ([]Sample, error)

QueryInstant executes an instant PromQL query and returns the matching samples.

type Sample

type Sample struct {
	Metric map[string]string
	Value  float64
}

Sample is a single instant-query result: the series labels and its value.

func (*Sample) String

func (s *Sample) String() string

Jump to

Keyboard shortcuts

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