collectors

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2019 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Overview

TODO: rename collector

Index

Constants

This section is empty.

Variables

View Source
var (
	ScrapeErrorTotalMetric = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Name: "ksm_scrape_error_total",
			Help: "Total scrape errors encountered when scraping a resource",
		},
		[]string{"resource"},
	)

	ResourcesPerScrapeMetric = prometheus.NewSummaryVec(
		prometheus.SummaryOpts{
			Name: "ksm_resources_per_scrape",
			Help: "Number of resources returned per scrape",
		},
		[]string{"resource"},
	)
)

Functions

This section is empty.

Types

type Builder added in v1.5.0

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

Builder helps to build collectors. It follows the builder pattern (https://en.wikipedia.org/wiki/Builder_pattern).

func NewBuilder added in v1.5.0

func NewBuilder(
	ctx context.Context,
) *Builder

NewBuilder returns a new builder.

func (*Builder) Build added in v1.5.0

func (b *Builder) Build() []*Collector

Build initializes and registers all enabled collectors.

func (*Builder) WithEnabledCollectors added in v1.5.0

func (b *Builder) WithEnabledCollectors(c []string)

WithEnabledCollectors sets the enabledCollectors property of a Builder.

func (*Builder) WithKubeClient added in v1.5.0

func (b *Builder) WithKubeClient(c clientset.Interface)

WithKubeClient sets the kubeClient property of a Builder.

func (*Builder) WithNamespaces added in v1.5.0

func (b *Builder) WithNamespaces(n options.NamespaceList)

WithNamespaces sets the namespaces property of a Builder.

func (*Builder) WithWhiteBlackList added in v1.5.0

func (b *Builder) WithWhiteBlackList(l whiteBlackLister)

WithWhiteBlackList configures the white or blacklisted metrics to be exposed by the collectors build by the Builder

type Collector added in v1.5.0

type Collector struct {
	Store Store
}

Collector represents a kube-state-metrics metric collector. It is a stripped down version of the Prometheus client_golang collector.

func NewCollector added in v1.5.0

func NewCollector(s Store) *Collector

NewCollector constructs a collector with the given Store.

func (*Collector) Collect added in v1.5.0

func (c *Collector) Collect(w io.Writer)

Collect returns all metrics of the underlying store of the collector.

type Store added in v1.5.0

type Store interface {
	WriteAll(io.Writer)
}

Store represents a metrics store e.g. k8s.io/kube-state-metrics/pkg/metrics_store.

Jump to

Keyboard shortcuts

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