pkg

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LabelNamespace = "namespace"
	LabelPod       = "pod"
	LabelContainer = "container"
)

Variables

View Source
var (
	CommonLabels = []string{LabelNamespace, LabelPod, LabelContainer}
	DescCpuUsage = prometheus.NewDesc("container_cpu_usage_cores", "CPU cores used", CommonLabels, nil)
	DescMemUsage = prometheus.NewDesc("container_memory_usage_bytes", "memory used", CommonLabels, nil)
)

Functions

This section is empty.

Types

type Config added in v1.2.0

type Config struct {
	Namespace        string   `default:"default" usage:"the namespace of the pods to collect"`
	IgnoreNamespaces []string `default:"kube-system" usage:"when 'namespace' is empty, this lists namespaces to ignore"`
	HttpBinding      string   `usage:"binding of http listener for metrics export" default:":8080"`
	MetricsPath      string   `usage:"http path for metrics export" default:"/metrics"`
	Debug            bool     `usage:"enable debug logging"`
}

configuration for the exporter

type Handler added in v1.2.0

type Handler struct {
	ExporterConfig Config
	Logger         *zap.Logger
	ClientSet      *versioned.Clientset
	KubeConfig     *rest.Config
	// contains filtered or unexported fields
}

func (*Handler) GetNamespaces added in v1.2.0

func (h *Handler) GetNamespaces() (ns []string, err error)

func (*Handler) SetupCollector added in v1.2.0

func (h *Handler) SetupCollector(mu *sync.RWMutex) (err error)

func (*Handler) UpdateNamespaces added in v1.2.0

func (h *Handler) UpdateNamespaces(namespaces []string)

type KubeMetricsCollector

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

func NewKubeMetricsCollector

func NewKubeMetricsCollector(logger *zap.Logger, clientset *versioned.Clientset, mu *sync.RWMutex) *KubeMetricsCollector

func (*KubeMetricsCollector) Collect

func (c *KubeMetricsCollector) Collect(metrics chan<- prometheus.Metric)

func (*KubeMetricsCollector) Describe

func (c *KubeMetricsCollector) Describe(descs chan<- *prometheus.Desc)

func (*KubeMetricsCollector) UpdateNamespaces added in v1.2.0

func (c *KubeMetricsCollector) UpdateNamespaces(namespaces []string)

Jump to

Keyboard shortcuts

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