Help us shape the future of Go! Take the 2026 Go Developer Survey

metricproxy

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2019 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNameFieldOverrideAttempted = errors.New("cannot override name field with additional labels")
	ErrFileProxyScrapeError       = errors.New("file proxy file read failed")
	ErrUnknownExporterType        = errors.New("cannot configure unknown exporter type")
	ErrExporterNameUsedTwice      = errors.New("cannot use the same exporter name twice for one endpoint")
)

nolint: golint

View Source
var (
	// ErrScrapeTimeoutBeforeExecFinished returned when a context times out before the exec exporter receives metrics
	ErrScrapeTimeoutBeforeExecFinished = errors.New("scrape timed out before exec finished")
)

Functions

func NewMetricReverseProxy

func NewMetricReverseProxy(exporter config.ReverseExporter) (http.Handler, error)

NewMetricReverseProxy initializes a new reverse proxy from the given configuration.

Types

type MetricProxy

type MetricProxy interface {
	// Scrape returns the metrics.
	Scrape(ctx context.Context, values url.Values) ([]*dto.MetricFamily, error)
}

MetricProxy presents an interface which allows a context-cancellable scrape of a backend proxy

type ReverseProxyEndpoint

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

ReverseProxyEndpoint wraps a collection of ReverseProxyBackends. It exposes an HTTP endpoint able to be passed to the user and handles routing and authentication.

func (*ReverseProxyEndpoint) ServeHTTP

func (rpe *ReverseProxyEndpoint) ServeHTTP(wr http.ResponseWriter, req *http.Request)

ServeHTTP implements http.Handler by calling the designated wrapper function.

Jump to

Keyboard shortcuts

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