metrics

package
v1.20.0 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2026 License: Apache-2.0 Imports: 19 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.

For histogram metrics, three entries are emitted with a "quantile" label set to "0.5", "0.9", and "0.99" respectively, each holding the computed quantile value. For summary metrics, one entry per predefined quantile is emitted with the corresponding "quantile" label.

Types

type Config added in v1.15.0

type Config struct {
	OperatorPrometheusServeAddr string
	EnableMetrics               bool
}

Config contains the configuration for the operator-metrics cell.

func (Config) Flags added in v1.15.0

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

Jump to

Keyboard shortcuts

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