metricshandler

package
v1.9.8 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2021 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MetricsHandler

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

MetricsHandler is a http.Handler that exposes the main kube-state-metrics /metrics endpoint. It allows concurrent reconfiguration at runtime.

func New

func New(opts *options.Options, kubeClient kubernetes.Interface, storeBuilder *store.Builder, enableGZIPEncoding bool) *MetricsHandler

New creates and returns a new MetricsHandler with the given options.

func (*MetricsHandler) ConfigureSharding

func (m *MetricsHandler) ConfigureSharding(ctx context.Context, shard int32, totalShards int)

ConfigureSharding (re-)configures sharding. Re-configuration can be done concurrently.

func (*MetricsHandler) Run

func (m *MetricsHandler) Run(ctx context.Context) error

Run configures the MetricsHandler's sharding and if autosharding is enabled re-configures sharding on re-sharding events. Run should only be called once.

func (*MetricsHandler) ServeHTTP

func (m *MetricsHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implements the http.Handler interface. It writes the metrics in its stores to the response body.

Jump to

Keyboard shortcuts

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