mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-05 12:46:18 +01:00
33 lines
2.1 KiB
Plaintext
33 lines
2.1 KiB
Plaintext
// Module included in the following assemblies:
|
|
//
|
|
// *networking/associating-secondary-interfaces-metrics-to-network-attachments.adoc
|
|
|
|
:_mod-docs-content-type: CONCEPT
|
|
[id="cnf-metrics-secondary-interfaces-by-name_{context}"]
|
|
= Metrics with network name
|
|
|
|
The Network Metrics daemonset publishes a `pod_network_name_info` gauge metric, with a fixed value of `0`.
|
|
|
|
.Example of `pod_network_name_info`
|
|
[source,bash]
|
|
----
|
|
pod_network_name_info{interface="net0",namespace="namespacename",network_name="nadnamespace/firstNAD",pod="podname"} 0
|
|
----
|
|
|
|
The network name label is produced using the annotation added by Multus. It is the concatenation of the namespace the network attachment definition belongs to, plus the name of the network attachment definition.
|
|
|
|
The new metric alone does not provide much value, but combined with the network related `container_network_*` metrics, it offers better support for monitoring secondary networks.
|
|
|
|
Using a `promql` query like the following ones, it is possible to get a new metric containing the value and the network name retrieved from the `k8s.v1.cni.cncf.io/network-status` annotation:
|
|
|
|
[source,bash]
|
|
----
|
|
(container_network_receive_bytes_total) + on(namespace,pod,interface) group_left(network_name) ( pod_network_name_info )
|
|
(container_network_receive_errors_total) + on(namespace,pod,interface) group_left(network_name) ( pod_network_name_info )
|
|
(container_network_receive_packets_total) + on(namespace,pod,interface) group_left(network_name) ( pod_network_name_info )
|
|
(container_network_receive_packets_dropped_total) + on(namespace,pod,interface) group_left(network_name) ( pod_network_name_info )
|
|
(container_network_transmit_bytes_total) + on(namespace,pod,interface) group_left(network_name) ( pod_network_name_info )
|
|
(container_network_transmit_errors_total) + on(namespace,pod,interface) group_left(network_name) ( pod_network_name_info )
|
|
(container_network_transmit_packets_total) + on(namespace,pod,interface) group_left(network_name) ( pod_network_name_info )
|
|
(container_network_transmit_packets_dropped_total) + on(namespace,pod,interface) group_left(network_name)
|
|
---- |