metrics

package
v0.0.0-...-e1e1857 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Package metrics represents the reader and writer interface to remote write to and query from Prometheus for a set of labels.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(labels []prompb.Label) *prompb.WriteRequest

Generate takes a set of labels and metrics key-value pairs and returns the payload to write metrics to Prometheus.

func Query

func Query(
	ctx context.Context,
	l log.Logger,
	endpoint *url.URL,
	t auth.TokenProvider,
	query options.Query,
	tls options.TLS,
	defaultStep time.Duration,
) (int, promapiv1.Warnings, error)

Query executes a query specification, a set of queries, against Prometheus.

func Read

func Read(
	ctx context.Context,
	endpoint *url.URL,
	tp auth.TokenProvider,
	labels []prompb.Label,
	ago, latency time.Duration,
	m instr.Metrics,
	l log.Logger,
	tls options.TLS,
) (int, error)

Read executes query against Prometheus with the same labels to retrieve the written metrics back.

func Write

func Write(ctx context.Context, endpoint *url.URL, t auth.TokenProvider, wreq proto.Message, l log.Logger, tls options.TLS,
	tenantHeader string, tenant string) (int, error)

Write executes a remote-write against Prometheus sending a set of labels and metrics to store.

Types

This section is empty.

Jump to

Keyboard shortcuts

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