metrics

package
v0.0.0-...-61aa395 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// PodCreationReachabilityLatency is measured by watching for pod creations
	// and updates and immediately sending traffic to them, as soon as IP has been
	// assigned, to get a timestamp of the first successful request.
	// Pod's creationTimestamp (Start time).
	// First successful request (End time).
	// Reported time = End time - Start time.
	PodCreationReachabilityLatency = prometheus.NewHistogram(
		prometheus.HistogramOpts{
			Name:    "pod_creation_reachability_latency_seconds",
			Help:    "Latency (in seconds) for network policy to be enforced for new pods",
			Buckets: latencyBuckets,
		},
	)
	// PolicyEnforceLatencyPolicyCreation is measured by continuously sending
	// requests to pods to get timestamps of the first successful request.
	// Network policy's creationTimestamp (Start time).
	// First successful request (End time).
	// Reported time = End time - Start time.
	PolicyEnforceLatencyPolicyCreation = prometheus.NewHistogram(
		prometheus.HistogramOpts{
			Name:    "policy_enforcement_latency_policy_creation_seconds",
			Help:    "Latency (in seconds) for new network policy to be enforced for new network policies",
			Buckets: latencyBuckets,
		},
	)
	// PodIPAddressAssignedLatency is measured by watching for pod updates.
	// Pod's creationTimestamp (Start time).
	// The first pod update that has IP assigned (End time).
	// Reported time = End time - Start time.
	PodIPAddressAssignedLatency = prometheus.NewHistogram(
		prometheus.HistogramOpts{
			Name:    "pod_ip_address_assigned_latency_seconds",
			Help:    "Latency (in seconds) for IP address to be assigned to a pod, after pod creation",
			Buckets: latencyBuckets,
		},
	)
)

Functions

func RegisterMetrics

func RegisterMetrics(metric ...prometheus.Collector)

RegisterMetrics registers the provided prometheus metrics.

func StartMetricsServer

func StartMetricsServer(listenAddr string) *http.Server

StartMetricsServer runs a Prometheus HTTP server that exposes metrics on the specified port.

Types

This section is empty.

Jump to

Keyboard shortcuts

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