prometheus

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2026 License: MIT Imports: 9 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 struct {
	// contains filtered or unexported fields
}

Client wraps the Prometheus HTTP API.

func NewClient

func NewClient(cfg config.PrometheusConfig) (*Client, error)

NewClient creates a Client configured from cfg.

func (*Client) API

func (c *Client) API() promv1.API

API returns the underlying Prometheus v1 API.

type MetricReader

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

MetricReader implements dataplane.MetricReader against the Prometheus HTTP API.

func NewMetricReader

func NewMetricReader(c *Client) *MetricReader

NewMetricReader creates a MetricReader from the given Client.

func (*MetricReader) Percentiles

func (r *MetricReader) Percentiles(ctx context.Context, service, action string, window time.Duration) (*dataplane.LatencyPercentiles, error)

Percentiles queries Prometheus for per-action latency percentiles over the given window duration.

func (*MetricReader) ServiceStats

func (r *MetricReader) ServiceStats(ctx context.Context, service string, window time.Duration) (*dataplane.ServiceMetrics, error)

ServiceStats queries Prometheus for aggregate service metrics over the given window duration and returns them as a ServiceMetrics value.

type MetricWriter

type MetricWriter struct{}

MetricWriter is a no-op implementation of dataplane.MetricWriter.

In production mode, the OTel SDK emits metrics directly to the Collector, which Prometheus then scrapes. This interface exists for symmetry with the local-mode data plane.

func NewMetricWriter

func NewMetricWriter() *MetricWriter

NewMetricWriter returns a no-op MetricWriter.

func (*MetricWriter) Record

func (w *MetricWriter) Record(_ context.Context, _, _ string, _ float64, _ int) error

Record is a no-op; metrics are emitted by the OTel SDK out-of-band.

Jump to

Keyboard shortcuts

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