metrics

package
v0.0.0-...-7654c43 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2025 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	DefaultEnableMetrics        bool
	EnableGatewayMetrics        bool
	DefaultEnableMetricsMerging bool
	DefaultMergedMetricsPort    string
	DefaultPrometheusScrapePort string
	DefaultPrometheusScrapePath string
}

Config represents configuration common to connect-inject components related to metrics.

func (Config) EnableMetrics

func (mc Config) EnableMetrics(pod corev1.Pod) (bool, error)

EnableMetrics returns whether metrics are enabled either via the default value in the meshWebhook, or if it's been overridden via the annotation.

func (Config) EnableMetricsMerging

func (mc Config) EnableMetricsMerging(pod corev1.Pod) (bool, error)

EnableMetricsMerging returns whether metrics merging functionality is enabled either via the default value in the meshWebhook, or if it's been overridden via the annotation.

func (Config) MergedMetricsPort

func (mc Config) MergedMetricsPort(pod corev1.Pod) (string, error)

MergedMetricsPort returns the port to run the merged metrics server on, either via the default value in the meshWebhook, or if it's been overridden via the annotation. It also validates the port is in the unprivileged port range.

func (Config) MergedMetricsServerConfiguration

func (mc Config) MergedMetricsServerConfiguration(pod corev1.Pod) (metricsPorts, error)

MergedMetricsServerConfiguration is called when running a merged metrics server and used to return ports necessary to configure the merged metrics server.

func (Config) PrometheusScrapePath

func (mc Config) PrometheusScrapePath(pod corev1.Pod) string

PrometheusScrapePath returns the path for Prometheus to scrape from, either via the default value in the meshWebhook, or if it's been overridden via the annotation.

func (Config) PrometheusScrapePort

func (mc Config) PrometheusScrapePort(pod corev1.Pod) (string, error)

PrometheusScrapePort returns the port for Prometheus to scrape from, either via the default value in the meshWebhook, or if it's been overridden via the annotation. It also validates the port is in the unprivileged port range.

func (Config) ServiceMetricsPath

func (mc Config) ServiceMetricsPath(pod corev1.Pod) string

ServiceMetricsPath returns a default of /metrics, or overrides that with the annotation if provided.

func (Config) ServiceMetricsPort

func (mc Config) ServiceMetricsPort(pod corev1.Pod) (string, error)

ServiceMetricsPort returns the port the service exposes metrics on. This will default to the port used to register the service with Consul, and can be overridden with the annotation if provided.

func (Config) ShouldRunMergedMetricsServer

func (mc Config) ShouldRunMergedMetricsServer(pod corev1.Pod) (bool, error)

ShouldRunMergedMetricsServer returns whether we need to run a merged metrics server. This is used to configure the consul sidecar command, and the init container, so it can pass appropriate arguments to the consul connect envoy command.

Jump to

Keyboard shortcuts

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