metrics

package
v0.11.0-rc0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// OperatorPortName defines the default operator metrics port name used in the metrics Service.
	OperatorPortName = "http-metrics"
	// CRPortName defines the custom resource specific metrics' port name used in the metrics Service.
	CRPortName = "cr-metrics"
)

Variables

View Source
var ErrServiceMonitorNotPresent = fmt.Errorf("no ServiceMonitor registered with the API")

Functions

func CreateMetricsService

func CreateMetricsService(ctx context.Context, cfg *rest.Config, servicePorts []v1.ServicePort) (*v1.Service, error)

CreateMetricsService creates a Kubernetes Service to expose the passed metrics port(s) with the given name(s).

func CreateServiceMonitors

func CreateServiceMonitors(config *rest.Config, ns string, services []*v1.Service) ([]*monitoringv1.ServiceMonitor, error)

CreateServiceMonitors creates ServiceMonitors objects based on an array of Service objects. If CR ServiceMonitor is not registered in the Cluster it will not attempt at creating resources.

func GenerateServiceMonitor

func GenerateServiceMonitor(ns string, s *v1.Service) *monitoringv1.ServiceMonitor

GenerateServiceMonitor generates a prometheus-operator ServiceMonitor object based on the passed Service object.

Types

type ServiceMonitorUpdater

type ServiceMonitorUpdater func(*monitoringv1.ServiceMonitor) error

Jump to

Keyboard shortcuts

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