collectors

package
v0.0.0-...-5dd08fc Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2021 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CLUSTER_CPU_UTILIZATION_PSQL     = `1-avg(rate(node_cpu_seconds_total{mode="idle"}[5m]))`
	CLUSTER_MEMORY_UTILIZATION_PSQL  = `1 - sum(:node_memory_MemAvailable_bytes:sum{}) / sum(kube_node_status_allocatable_memory_bytes{})`
	CLUSTER_STORAGE_UTILIZATION_PSQL = `` /* 159-byte string literal not displayed */
)
View Source
const (
	NODE_CPU_UTILIZATION_PSQL     = `sum by (instance) (instance:node_cpu_utilisation:rate1m{job="node-exporter"})`
	NODE_MEMORY_UTILIZATION_PSQL  = `sum by (instance) (instance:node_memory_utilisation:ratio{job="node-exporter"})`
	NODE_STORAGE_UTILIZATION_PSQL = `` /* 188-byte string literal not displayed */
)

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

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

func NewBuilder(
	ctx context.Context,
) *Builder

NewBuilder returns a new builder.

func (*Builder) Build

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

Build initializes and registers all enabled collectors.

func (*Builder) WithApiserver

func (b *Builder) WithApiserver(apiserver string) *Builder

func (*Builder) WithEnabledCollectors

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

WithEnabledCollectors sets the enabledCollectors property of a Builder.

func (*Builder) WithKubeConfig

func (b *Builder) WithKubeConfig(kubeconfig string) *Builder

func (*Builder) WithNamespaces

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

WithNamespaces sets the namespaces property of a Builder.

func (*Builder) WithPrometheus

func (b *Builder) WithPrometheus(prom string) *Builder

WithPrometheus sets the prometheus property of a Builder.

func (*Builder) WithWhiteBlackList

func (b *Builder) WithWhiteBlackList(l whiteBlackLister) *Builder

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

type ClusterValue

type ClusterValue struct {
	metav1.ObjectMeta `json:"metadata" protobuf:"bytes,1,opt,name=metadata"`
	CPU               *metric.Metric
	Memory            *metric.Metric
	Storage           *metric.Metric
	Info              *metric.Metric
}

type NodeValues

type NodeValues struct {
	metav1.ObjectMeta `json:"metadata" protobuf:"bytes,1,opt,name=metadata"`
	CPU               []*metric.Metric
	Memory            []*metric.Metric
	Storage           []*metric.Metric
}

Jump to

Keyboard shortcuts

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