metrics

package
v1.19.0 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2026 License: Apache-2.0 Imports: 16 Imported by: 9

Documentation

Index

Constants

View Source
const (
	// OperatorPrometheusEnableTLS enable TLS for prometheus server
	OperatorPrometheusEnableTLS = "operator-prometheus-enable-tls"

	// OperatorPrometheusTLSCertFile specifies path to TLS certificate file
	// for prometheus server. The file must contain PEM encoded data.
	OperatorPrometheusTLSCertFile = "operator-prometheus-tls-cert-file"

	// OperatorPrometheusTLSKeyFile specifies path to TLS private key file
	// for prometheus server. The file must contain PEM encoded data.
	OperatorPrometheusTLSKeyFile = "operator-prometheus-tls-key-file"

	// OperatorPrometheusTLSClientCAFiles specifies path to one or more TLS client CA certificates files
	// to use for TLS with mutual authentication (mTLS) for prometheus server.
	// The files must contain PEM encoded data.
	// When provided, this option effectively enables mTLS.
	OperatorPrometheusTLSClientCAFiles = "operator-prometheus-tls-client-ca-files"
)
View Source
const (
	// OperatorPrometheusServeAddr IP:Port on which to serve prometheus metrics
	// (pass ":<port>" to bind on all interfaces).
	OperatorPrometheusServeAddr = "operator-prometheus-serve-addr"
)

Variables

View Source
var Cell = cell.Module(
	"operator-metrics",
	"Operator Metrics",

	certloaderGroup,
	cell.Config(defaultConfig),

	cell.Provide(func(conf Config) metrics.RegistryConfig {
		return metrics.RegistryConfig{
			PrometheusServeAddr: conf.OperatorPrometheusServeAddr,
		}
	}),

	metrics.NewCell("operator"),
	cell.Invoke(initializeMetrics),
)

Cell provides the modular metrics registry, metric HTTP server and legacy metrics cell for the operator.

Functions

func DumpMetrics

func DumpMetrics(reg *metrics.Registry) ([]*models.Metric, error)

DumpMetrics gets the current Cilium operator metrics and dumps all into a Metrics structure. If metrics cannot be retrieved, returns an error.

Types

type Config added in v1.15.0

type Config struct {
	OperatorPrometheusServeAddr string
}

Config contains the configuration for the operator-metrics cell.

func (Config) Flags added in v1.15.0

func (def Config) Flags(flags *pflag.FlagSet)

type SharedConfig added in v1.15.0

type SharedConfig struct {
	// EnableMetrics is set to true if operator metrics are enabled
	EnableMetrics bool
}

SharedConfig contains the configuration that is shared between this module and others.

Jump to

Keyboard shortcuts

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