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: 0

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