Skip to content

Commit

Permalink
fix(netstat): enable curated stats for tcp connections (#1004)
Browse files Browse the repository at this point in the history
Reduce cardinality of `tcp_connection_stats` by only keeping curated
stats. Updates curated stats to include:
- timeouts
- loss probes
- loss retransmit

Curation was off, but there were already several curated stats for drops
and errors.

### Testing

I only see these stats after this change:

```
networkobservability_tcp_connection_stats{statistic_name="TCPLossProbes"} 233948
networkobservability_tcp_connection_stats{statistic_name="TCPLostRetransmit"} 143
networkobservability_tcp_connection_stats{statistic_name="TCPTimeouts"} 240
```

In a steady state cluster, the first stat seems to slowly increase over
time, and the other two are constant.

Signed-off-by: Hunter Gregory <42728408+huntergregory@users.noreply.github.com>
  • Loading branch information
huntergregory authored Nov 13, 2024
1 parent 5a2a0e8 commit cf0e69a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/plugin/linuxutil/linuxutil_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func (lu *linuxUtil) run(ctx context.Context) error {
return nil
case <-ticker.C:
opts := &NetstatOpts{
CuratedKeys: false,
CuratedKeys: true,
AddZeroVal: false,
ListenSock: false,
PrevTCPSockStats: lu.prevTCPSockStats,
Expand Down
3 changes: 3 additions & 0 deletions pkg/plugin/linuxutil/types_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ var netstatCuratedKeys = map[string]struct{}{
"DataCsumErr": {},
"AddAddrDrop": {},
"RmAddrDrop": {},
"TCPTimeouts": {},
"TCPLossProbes": {},
"TCPLostRetransmit": {},
}

type ConnectionStats struct {
Expand Down

0 comments on commit cf0e69a

Please sign in to comment.