func InitializeWindowsMetrics()

in npm/metrics/prometheus-metrics.go [214:320]


func InitializeWindowsMetrics() {
	klog.Infof("initializing Windows metrics. will not register the newly created metrics in this function")

	listEndpointsLatency = prometheus.NewHistogram(
		prometheus.HistogramOpts{
			Namespace: namespace,
			Name:      "list_endpoints_latency_seconds",
			Subsystem: windowsPrefix,
			Help:      "Latency  in seconds to list HNS endpoints latency",
			//nolint:gomnd // default bucket consts
			Buckets: prometheus.ExponentialBuckets(0.008, 2, 14), // upper bounds of 8 ms to 65 seconds
		},
	)

	getEndpointLatency = prometheus.NewHistogram(
		prometheus.HistogramOpts{
			Namespace: namespace,
			Name:      "get_endpoint_latency_seconds",
			Subsystem: windowsPrefix,
			Help:      "Latency in seconds to get a single HNS endpoint",
			//nolint:gomnd // default bucket consts
			Buckets: prometheus.ExponentialBuckets(0.008, 2, 14), // upper bounds of 8 ms to 65 seconds
		},
	)

	getNetworkLatency = prometheus.NewHistogram(
		prometheus.HistogramOpts{
			Namespace: namespace,
			Name:      "get_network_latency_seconds",
			Subsystem: windowsPrefix,
			Help:      "Latency in seconds to get the HNS network",
			//nolint:gomnd // default bucket consts
			Buckets: prometheus.ExponentialBuckets(0.008, 2, 14), // upper bounds of 8 ms to 65 seconds
		},
	)

	aclLatency = prometheus.NewHistogramVec(
		prometheus.HistogramOpts{
			Namespace: namespace,
			Name:      "acl_latency_seconds",
			Subsystem: windowsPrefix,
			Help:      "Latency in seconds to add/update ACLs by operation label",
			//nolint:gomnd // default bucket consts
			Buckets: prometheus.ExponentialBuckets(0.008, 2, 14), // upper bounds of 8 ms to 65 seconds
		},
		[]string{operationLabel},
	)

	setPolicyLatency = prometheus.NewHistogramVec(
		prometheus.HistogramOpts{
			Namespace: namespace,
			Name:      "setpolicy_latency_seconds",
			Subsystem: windowsPrefix,
			Help:      "Latency in seconds to add/update/delete SetPolicies by operation & is_nested label",
			//nolint:gomnd // default bucket consts
			Buckets: prometheus.ExponentialBuckets(0.008, 2, 14), // upper bounds of 8 ms to 65 seconds
		},
		[]string{operationLabel, isNestedLabel},
	)

	listEndpointsFailures = prometheus.NewCounter(
		prometheus.CounterOpts{
			Namespace: namespace,
			Name:      "list_endpoints_failure_total",
			Subsystem: windowsPrefix,
			Help:      "Number of failures while listing HNS endpoints",
		},
	)

	getEndpointFailures = prometheus.NewCounter(
		prometheus.CounterOpts{
			Namespace: namespace,
			Name:      "get_endpoint_failure_total",
			Subsystem: windowsPrefix,
			Help:      "Number of failures while getting a single HNS endpoint",
		},
	)

	getNetworkFailures = prometheus.NewCounter(
		prometheus.CounterOpts{
			Namespace: namespace,
			Name:      "get_network_failure_total",
			Subsystem: windowsPrefix,
			Help:      "Number of failures while getting the HNS network",
		},
	)

	aclFailures = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Namespace: namespace,
			Name:      "acl_failure_total",
			Subsystem: windowsPrefix,
			Help:      "Number of failures while adding/updating ACLs by operation label",
		},
		[]string{operationLabel},
	)

	setPolicyFailures = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Namespace: namespace,
			Name:      "setpolicy_failure_total",
			Subsystem: windowsPrefix,
			Help:      "Number of failures while adding/updating/deleting SetPolicies by operation & is_nested label",
		},
		[]string{operationLabel, isNestedLabel},
	)
}