Documentation
¶
Index ¶
- type Config
- func (mc Config) EnableMetrics(pod corev1.Pod) (bool, error)
- func (mc Config) EnableMetricsMerging(pod corev1.Pod) (bool, error)
- func (mc Config) MergedMetricsPort(pod corev1.Pod) (string, error)
- func (mc Config) MergedMetricsServerConfiguration(pod corev1.Pod) (metricsPorts, error)
- func (mc Config) PrometheusScrapePath(pod corev1.Pod) string
- func (mc Config) PrometheusScrapePort(pod corev1.Pod) (string, error)
- func (mc Config) ServiceMetricsPath(pod corev1.Pod) string
- func (mc Config) ServiceMetricsPort(pod corev1.Pod) (string, error)
- func (mc Config) ShouldRunMergedMetricsServer(pod corev1.Pod) (bool, error)
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 ¶
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 ¶
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 ¶
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 ¶
MergedMetricsServerConfiguration is called when running a merged metrics server and used to return ports necessary to configure the merged metrics server.
func (Config) PrometheusScrapePath ¶
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 ¶
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 ¶
ServiceMetricsPath returns a default of /metrics, or overrides that with the annotation if provided.
func (Config) ServiceMetricsPort ¶
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 ¶
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.