> For the complete documentation index, see [llms.txt](https://docs.cennso.com/components/fpp/latest/llms.txt) (all documentation: [llms.txt](https://docs.cennso.com/llms.txt)). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cennso.com/components/fpp/latest/observability/metrics.md).

# Metrics

Fast Path Provider (FPP) exposes metrics in the Prometheus format on the `/metrics` endpoint on port `9482`.

The following metrics are available:

| Name | Type | Description |
|:---|:---|:---|
| govpp_channels_active | GAUGE | (internal debug) Number of currently active binapi channels.
| govpp_channel_ids_available | GAUGE | (internal debug) Number of IDs available in binapi channel idPool. Max 32767.
| vpp_arp_hw_addr_not_match_l2_frame | COUNTER | Number of ARP errors indicating that the frame L2 source address doesn't match the HW address. Example: `vpp_arp_hw_addr_not_match_l2_frame{node="arp-reply"} 0`
| vpp_arp_replies_sent | COUNTER | Number of ARP replies sent by the dedicated VPP node. Example: `vpp_arp_replies_sent{node="arp-reply"} 1`
| vpp_arp_requests_sent | COUNTER | Number of ARP requests sent by the dedicated VPP node. Example: `vpp_arp_requests_sent{node="ip4-arp"} 1`
| vpp_buffer_pools_available | GAUGE | Number of VPP buffers that are not used. Example: `vpp_buffer_pools_available{numa="default-numa-0"} 251935`, where `numa` is a name from which NUMA node this metric is
| vpp_buffer_pools_cached | GAUGE | Number of VPP buffers that are cached. Example: `vpp_buffer_pools_cached{numa="default-numa-0"} 0`
| vpp_buffer_pools_used | GAUGE | Number of used VPP buffers. Example: `vpp_buffer_pools_used{numa="default-numa-0"} 4097`
| vpp_interface_bytes | COUNTER | Bytes processed by interface RX and TX queues. Example: `vpp_interface_bytes{name="sgi0",type="tx"} 42`, where `name` is a VPP interface name, and `type` is either `rx` or `tx`
| vpp_interface_errors | COUNTER | VPP device errors for each interface. Example: `vpp_interface_errors{name="sgi0", type="interface_is_down"} 10`, where `name` is a VPP interface name, and `type` is one of: `interface_is_down`, `bond_traffic_on_passive`, `bond_pass_through`, `no_buffer_gso`, `memif_no_enough_space_tx_buffers`, `tap_truncated_tx_ring`, `tap_pending_msgs_tx_ring`, `tap_indirect_desc_alloc_failed`, `tap_ooo_buffers_in_ring`, `tap_gso_disabled_drop`, `tap_chcksm_offload_disabled`, `dpdk_tx_function_error`, `dpdk_tx_packet_drop`
| vpp_interface_info | GAUGE | VPP interface information. Example: `vpp_interface_info{ip_addr="172.18.1.2",is_ipv4="1",is_ipv6="0",l3mtu="9000",mac_addr="fa:8a:78:4d:5b:5b",name="sxb",uplink="IF_STATUS_API_FLAG_ADMIN_UP\|IF_STATUS_API_FLAG_LINK_UP"} 1`
| vpp_interface_no_tx_slots | COUNTER | Number of packets dropped by the interface due to no TX slots available. Example: `vpp_interface_no_tx_slots{name="tap0"} 0`, where `name` is a VPP interface name
| vpp_interface_packets | COUNTER | Packets processed by interface RX and TX queues. Example: `vpp_interface_packets{name="sgi0",type="rx"} 19`, where `name` is a VPP interface name, and `type` is either `rx` or `tx`
| vpp_main_heap_free_bytes | GAUGE | Number of bytes free for the heap memory segment. Example: `vpp_main_heap_free_bytes 123`
| vpp_main_heap_total_bytes | GAUGE | Size of the heap memory segment. Example: `vpp_main_heap_total_bytes 123`
| vpp_main_heap_used_bytes | GAUGE | Number of bytes used from the heap memory segment. Example: `vpp_main_heap_used_bytes 123`
| vpp_netcap_streams_created | GAUGE | Number of NetCap streams created. Example: `vpp_netcap_streams_created 1` |
| vpp_netcap_dropped_packets_total | COUNTER | Number of packets dropped because of the reason provided in the label. Example: `vpp_netcap_dropped_packets_total{reason="ring-overflow"} 123` where reason is one of: `ring-overflow` - if NetCap Collector is too slow to process packets, `stream-stopped` - if stream in stopped state |
| vpp_nat_flow_count | GAUGE | Number of NAT flows. Example: `vpp_nat_flow_count{index="0",thread="0"} 123`
| vpp_max_nat_flows | GAUGE | Maximum number of NAT flows. Example: `vpp_max_nat_flows 10000000`
| vpp_nat_max_flows_exceeded | COUNTER | Number of NAT translations that can't be created due to the maximum number of flows  per NAT node is reached. Example: `vpp_nat_max_flows_exceeded{node="nat44-ed-in2out-slowpath"} 123`
| vpp_nat_out_of_ports | COUNTER | Number of NAT Flows can't be created because of translation port can not be allocated. Example: `vpp_nat_out_of_ports{node="nat44-ed-in2out-slowpath"} 123`
| vpp_node_calls | COUNTER | Number of calls for the defined VPP nodes. Example: `vpp_node_calls{name="tcp4-established"} 0`, where `name` is a [VPP node name](#vpp-node-names)
| vpp_node_clocks | COUNTER | Number of clock cycles used by the defined VPP nodes. Example: `vpp_node_clocks{name="tcp4-established"}`, where `name` is a [VPP node name](#vpp-node-names)
| vpp_node_suspends | COUNTER | Number of suspends for the defined VPP nodes. Example: `vpp_node_suspends{name="tcp4-established"} 0`, where `name` is a [VPP node name](#vpp-node-names)
| vpp_node_vectors | COUNTER | Number of vectors processed by the defined VPP node. Example: `vpp_node_vectors{name="tcp4-established"} 0`, where `name` is a [VPP node name](#vpp-node-names)
| vpp_stat_seg_free_bytes | GAUGE | Number of bytes free for the Stats memory segment. Example: `vpp_stat_seg_free_bytes 123`
| vpp_stat_seg_total_bytes | GAUGE | Size of the Stats memory segment. Example: `vpp_stat_seg_total_bytes 123`
| vpp_stat_seg_used_bytes | GAUGE | Number of bytes used from the Stats memory segment. Example: `vpp_stat_seg_used_bytes 123`
| vpp_sys_vector_rate | GAUGE | Average length of packet vector. Example: `vpp_sys_vector_rate 1`
| vpp_sys_vector_rate_per_worker | GAUGE | Average length of each worker's packet vector. Example: `vpp_sys_vector_rate_per_worker{index="0",thread="0"} 1`
| vpp_sys_loops_per_second | GAUGE | Number of VPP worker loop cycles per second per worker. Example: `vpp_sys_loops_per_second{index="0",thread="0"} 1`
| vpp_uplink_ping_avg_rtt_ms | GAUGE | This is the average round-trip time for ping between the FPP nodes in milliseconds. Example: `vpp_uplink_ping_avg_rtt_ms{dst="10.99.99.2",src="10.99.99.1"} 4.292`
| vpp_uplink_ping_packets_received_total | COUNTER | Number of packets received when pinging another FPP node using the Uplink interface. Example: `vpp_uplink_ping_packets_received_total{dst="10.10.0.2",src="10.10.0.1"} 3135`
| vpp_uplink_ping_packets_sent_total | COUNTER | Number of packets sent when pinging another FPP node using the Uplink interface. Example: `vpp_uplink_ping_packets_sent_total{dst="10.10.0.2",src="10.10.0.1"} 3150`
| vpp_uplink_ping_path_state | GAUGE | State of the reachability between two FPP nodes. 0 - Down, 1 - Up. Example: `vpp_uplink_ping_path_state{dst="10.10.0.2",src="10.10.0.1"} 1`

## Labels

Each metric from the table above has the following list of labels attached:

- `cka=fpp` - label for all FPP metrics
- `container="fpp"` - metric from the `fpp` container
- `endpoint="prom-metrics"` - label for all FPP metrics
- `instance="{IP}:9482"` - `{IP}` is a Kubernetes IP of the FPP pod
- `job="{fpp_deploy}"` - name of the FPP DaemonSet
- `namespace="{fpp_ns}"` - name of the namespace where the FPP pod is deployed
- `nodename="{node_name}"` - full name of the node where the FPP pod is working, for example: `worker.cennso.net`
- `pod="{fpp_pod}"` - the name of the FPP pod
- `service="{fpp_deploy}"` - name of the FPP DaemonSet
- `short_nodename="{shot_name}"` - short name of the FPP pod host, for example: `worker-01`

The `vpp_sys_vector_rate_per_worker` and `vpp_sys_loops_per_second` metrics have attached labels that specify which specific `thread` and `index` those metrics describe.

## VPP node names

FPP exposes metrics with the following VPP node names:

- `drop`
- `tcp4-established`
- `upf-ip4-classify`
- `upf-ip4-input`
- `upf-ip4-proxy-input`
- `upf-ip4-session-dpo`
- `upflb-gtpu-rewrite`, only in a Connectivity Gateway (CGW) with User Plane Function (UPF) load balancing enabled

## UPF-LB metrics

> [!IMPORTANT]
> UPF load balancing is an alpha feature and is not suitable for production deployments.

A CGW with the [UPF load balancer (UPF-LB)](https://docs.cennso.com/components/fpp/latest/deployment-guides/upflb.md) enabled exposes these metrics on the same endpoint.
Other FPP instances do not expose them.

The following table lists the UPF-LB metrics:

| Name | Type | Description |
|:---|:---|:---|
| vpp_upflb_nats_ready | GAUGE | `1` while UPF-LB is connected to NATS and receives updates. Example: `vpp_upflb_nats_ready 1` |
| vpp_upflb_kv_snapshot_complete | GAUGE | `1` once UPF-LB replays the whole key-value (KV) bucket and removes stale entries. A replay that lost records keeps it at `0`. Example: `vpp_upflb_kv_snapshot_complete 1` |
| vpp_upflb_kv_snapshot_sweeps_skipped_total | GAUGE | Number of replays that lost records and could not remove stale entries. Example: `vpp_upflb_kv_snapshot_sweeps_skipped_total 0` |
| vpp_upflb_kv_updates_total | GAUGE | Number of KV records that UPF-LB received, by `result`: `applied`, `rejected` (invalid key or value, the previous value stays), or `stale` (from a connection that a reconnect already replaced). Example: `vpp_upflb_kv_updates_total{result="applied"} 1024` |
| vpp_upflb_kv_channel_lost_total | GAUGE | Number of KV records lost inside UPF-LB before they were applied, by `end`: `producer` or `consumer`. A value above `0` triggers a full resynchronization. Example: `vpp_upflb_kv_channel_lost_total{end="producer"} 0` |
| vpp_upflb_kv_entries | GAUGE | Number of keys received from the bucket. Example: `vpp_upflb_kv_entries 1024` |
| vpp_upflb_kv_entries_installed | GAUGE | Number of received keys installed in the forwarding tables. A lower value than **vpp_upflb_kv_entries** means that some keys refer to a Network Instance (NWI) that does not exist yet. Example: `vpp_upflb_kv_entries_installed 1024` |
| vpp_upflb_rewrite_packets_total | GAUGE | Number of packets handled by UPF-LB, by `result`, for example `rewritten`, `passed`, `switched`, `no_entry`, `no_own_ip`, `not_claimed`, or `echo_replied`. Example: `vpp_upflb_rewrite_packets_total{result="rewritten"} 4096` |

## IPsec metrics

> [!IMPORTANT]
> IPsec support is an alpha feature and is not suitable for production deployments.

A CGW with [IPsec](https://docs.cennso.com/components/fpp/latest/deployment-guides/ipsec.md) and **spec.ipsec.metricsEnabled** set to `true` exposes the metrics of the `ipsec-exporter` `VPPTool` on port `9536`.
These metrics are the same as in CGW 1.x and use the `strongswan_` prefix.
For the list of metrics, see [IPsec Exporter metrics](https://docs.cennso.com/components/cgw/1.12/observability/metrics.md#ipsec-exporter) in the CGW documentation.
