diff --git a/docs/03-Metrics/02-hubble_metrics.md b/docs/03-Metrics/02-hubble_metrics.md index 649c8fd8c4..5bf20d95a8 100644 --- a/docs/03-Metrics/02-hubble_metrics.md +++ b/docs/03-Metrics/02-hubble_metrics.md @@ -31,7 +31,7 @@ The table below outlines the different metrics generated. | **networkobservability_drop_count** | Total dropped packet count | `direction`, `reason` | ✅ | ✅ | | **networkobservability_drop_bytes** | Total dropped byte count | `direction`, `reason` | ✅ | ❌ | | **networkobservability_tcp_state** | TCP currently active socket count by TCP state. | `state` | ✅ | ❌ | -| **networkobservability_tcp_connection_remote** | TCP currently active socket count by remote address. | `address` (IP:port) | ✅ | ❌ | +| **networkobservability_tcp_connection_remote** | TCP currently active socket count against remote addresses, aggregated across all of them. | `address` (always `AllIPs`) | ✅ | ❌ | | **networkobservability_tcp_connection_stats** | TCP connection statistics. (ex: Delayed ACKs, TCPKeepAlive, TCPSackFailures) | `statistic_name` | ✅ | ✅ | | **networkobservability_tcp_flag_gauges** | TCP packets count by flag. | `direction`, `flag` | ❌ | ✅ | | **networkobservability_ip_connection_stats** | IP connection statistics. | `statistic_name` | ✅ | ❌ | diff --git a/docs/03-Metrics/modes/basic.md b/docs/03-Metrics/modes/basic.md index 7674fbe506..2adba00cbb 100644 --- a/docs/03-Metrics/modes/basic.md +++ b/docs/03-Metrics/modes/basic.md @@ -67,7 +67,7 @@ Metrics enabled when `linuxutil` plugin is enabled (see [Metrics Configuration]( | Metric Name | Description | Extra Labels | | ----------------------- | ------------------------------------------------------------------------------- | ---------------------------------- | | `tcp_state` | TCP currently active socket count by TCP state (from `netstats` utility) | `state` | -| `tcp_connection_remote` | TCP currently active socket count by remote address (from `netstats` utility) | `address` (IP:port) | +| `tcp_connection_remote` | TCP currently active socket count against remote addresses, aggregated (from `netstats` utility) | `address` (always `AllIPs`) | | `tcp_connection_stats` | TCP connection statistics (from `netstats` utility) | `statistic_name` | | `ip_connection_stats` | IP connection statistics (from `netstats` utility) | `statistic_name` | | `udp_connection_stats` | UDP connection statistics (from `netstats` utility) | `statistic_name` | @@ -75,6 +75,8 @@ Metrics enabled when `linuxutil` plugin is enabled (see [Metrics Configuration]( #### Label Values +The `address` label of `tcp_connection_remote` is always `AllIPs`. Individual remote IP/port pairs are not exported, since that would make the metric's cardinality grow with the number of remote endpoints a node talks to. + Possible values for TCP `state`: - `UNKNOWN` diff --git a/docs/06-Troubleshooting/basic-metrics.md b/docs/06-Troubleshooting/basic-metrics.md index fe47638a83..6c79dd3831 100644 --- a/docs/06-Troubleshooting/basic-metrics.md +++ b/docs/06-Troubleshooting/basic-metrics.md @@ -101,11 +101,9 @@ retina_ip_connection_stats{statistic_name="InECT0Pkts"} 34713 retina_ip_connection_stats{statistic_name="InNoECTPkts"} 3.8893357e+07 retina_ip_connection_stats{statistic_name="InOctets"} 1.6718610902e+10 retina_ip_connection_stats{statistic_name="OutOctets"} 2.7768258214e+10 -# HELP retina_tcp_connection_remote number of active TCP connections by remote address +# HELP retina_tcp_connection_remote number of active TCP connections against remote addresses # TYPE retina_tcp_connection_remote gauge -retina_tcp_connection_remote{address="0.0.0.0",port="0"} 8 -retina_tcp_connection_remote{address="10.0.0.1",port="443"} 1 -retina_tcp_connection_remote{address="10.224.0.105",port="7070"} 1 +retina_tcp_connection_remote{address="AllIPs"} 10 # HELP retina_tcp_connection_stats TCP connections Statistics # TYPE retina_tcp_connection_stats gauge retina_tcp_connection_stats{statistic_name="DelayedACKLocked"} 107 diff --git a/pkg/metrics/types.go b/pkg/metrics/types.go index 54f8446bb5..78fab854f3 100644 --- a/pkg/metrics/types.go +++ b/pkg/metrics/types.go @@ -30,7 +30,7 @@ const ( nodeConnectivityStatusGaugeDescription = "The last observed status of both ICMP and HTTP connectivity between the current Cilium agent and other Cilium nodes" nodeConnectivityLatencySecondsGaugeDescription = "The last observed latency between the current Cilium agent and other Cilium nodes in seconds" tcpStateGaugeDescription = "Number of active TCP connections by state" - tcpConnectionRemoteGaugeDescription = "Number of active TCP connections by remote address" + tcpConnectionRemoteGaugeDescription = "Number of active TCP connections against remote addresses, aggregated across all of them" tcpConnectionStatsGaugeDescription = "TCP connections statistics" tcpFlagGaugeDescription = "TCP gauges by flag" ipConnectionStatsGaugeDescription = "IP connections statistics" diff --git a/pkg/plugin/linuxutil/netstat_stats_linux.go b/pkg/plugin/linuxutil/netstat_stats_linux.go index d4d53107c7..a388b3255f 100644 --- a/pkg/plugin/linuxutil/netstat_stats_linux.go +++ b/pkg/plugin/linuxutil/netstat_stats_linux.go @@ -17,8 +17,10 @@ import ( ) const ( - pathNetNetstat = "/proc/net/netstat" - pathNetSnmp = "/proc/net/snmp" + pathNetNetstat = "/proc/net/netstat" + pathNetSnmp = "/proc/net/snmp" + // Remote sockets are aggregated under a single label value on purpose - exporting one + // series per remote IP/port makes the cardinality of this metric unbounded. addrDefaultTCPRemote = "AllIPs" )