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.
Click to show internal directories.
Click to hide internal directories.