metrics

package
v0.7.2 Latest Latest
Warning

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

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

Documentation

Overview

Package metrics holds the adapters that query a metrics backing service (an installed or connected add-on) for the agent's metrics-query path (ADR-0026).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PromQL

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

PromQL queries a Prometheus-HTTP-API-compatible metrics store over its instant-query API. Burrow connects to an existing store the user already runs and queries it — it never distributes the store (ADR-0026). Prometheus and VictoriaMetrics share the same /api/v1/query API, so this one adapter serves both. The store's in-cluster endpoint (host:port) is passed per query, along with an optional bearer token for an authenticated store.

func NewPromQL

func NewPromQL(hc *http.Client) PromQL

NewPromQL returns a PromQL querier using hc (defaulting to http.DefaultClient).

func (PromQL) QueryMetrics

func (p PromQL) QueryMetrics(ctx context.Context, endpoint, query, token string) ([]controlplane.MetricSample, error)

QueryMetrics runs an instant PromQL query against the store at endpoint and returns the matching samples. A non-empty token is sent as an Authorization: Bearer header for an authenticated store. A vector result yields one MetricSample per series (labels from metric, value and timestamp from the value pair); a scalar result yields a single MetricSample with no labels.

Jump to

Keyboard shortcuts

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