handler

package
v0.0.0-...-b6874f1 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2024 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Base64Suffix is appended to a label name in the request URL path to
	// mark the following label value as base64 encoded.
	Base64Suffix = "@base64"
)

Variables

This section is empty.

Functions

func Delete

func Delete(ms storage.MetricStore, jobBase64Encoded bool, logger log.Logger) func(http.ResponseWriter, *http.Request)

Delete returns a handler that accepts delete requests.

The returned handler is already instrumented for Prometheus.

func Healthy

func Healthy(ms storage.MetricStore) http.Handler

Healthy is used to report the health of the ops-exporter. It currently only uses the Healthy method of the MetricScore to detect healthy state.

The returned handler is already instrumented for Prometheus.

func InstrumentWithCounter

func InstrumentWithCounter(handlerName string, handler http.Handler) http.HandlerFunc

func Push

func Push(
	ms storage.MetricStore,
	replace, check, jobBase64Encoded bool,
	logger log.Logger,
) func(http.ResponseWriter, *http.Request)

Push returns an http.Handler which accepts samples over HTTP and stores them in the MetricStore. If replace is true, all metrics for the job and instance given by the request are deleted before new ones are stored. If check is true, the pushed metrics are immediately checked for consistency (with existing metrics and themselves), and an inconsistent push is rejected with http.StatusBadRequest.

The returned handler is already instrumented for Prometheus.

func Ready

func Ready(ms storage.MetricStore) http.Handler

Ready is used to report if the ops-exporter is ready to process requests. It currently only uses the Ready method of the MetricScore to detect ready state.

The returned handler is already instrumented for Prometheus.

func Static

func Static(root http.FileSystem, prefix string) http.Handler

Static serves the static files from the provided http.FileSystem.

The returned handler is already instrumented for Prometheus.

func Status

func Status(
	ms storage.MetricStore,
	root http.FileSystem,
	flags map[string]string,
	pathPrefix string,
	logger log.Logger,
) http.Handler

Status serves the status page.

The returned handler is already instrumented for Prometheus.

func WipeMetricStore

func WipeMetricStore(
	ms storage.MetricStore,
	logger log.Logger) http.Handler

WipeMetricStore deletes all the metrics in MetricStore.

The returned handler is already instrumented for Prometheus.

Types

This section is empty.

Jump to

Keyboard shortcuts

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