tcp_connection_duration should be measured in seconds
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 11.5k
- Forks
- 1.4k
- Avg merge
- 3d 22h
- Merged PRs (30d)
- 53
Description
We currently measure connection durations in milliseconds. It's probably more appropriate to measure connection durations in terms of seconds. In either case, we should use a histogram that makes sense for connection durations:
```
tcp_connection_duration_ms_bucket{direction="inbound",peer="src",tls="true",errno="ENOTCONN",le="1"} 0
tcp_connection_duration_ms_bucket{direction="inbound",peer="src",tls="true",errno="ENOTCONN",le="2"} 0
tcp_connection_duration_ms_bucket{direction="inbound",peer="src",tls="true",errno="ENOTCONN",le="3"} 0
tcp_connection_duration_ms_bucket{direction="inbound",peer="src",tls="true",errno="ENOTCONN",le="4"} 0
tcp_connection_duration_ms_bucket{direction="inbound",peer="src",tls="true",errno="ENOTCONN",le="5"} 0
tcp_connection_duration_ms_bucket{direction="inbound",peer="src",tls="true",errno="ENOTCONN",le="10"} 0
tcp_connection_duration_ms_bucket{direction="inbound",peer="src",tls="true",errno="ENOTCONN",le="20"} 0
tcp_connection_duration_ms_bucket{direction="inbound",peer="src",tls="true",errno="ENOTCONN",le="30"} 0
tcp_connection_duration_ms_bucket{direction="inbound",peer="src",tls="true",errno="ENOTCONN",le="40"} 0
tcp_connection_duration_ms_bucket{direction="inbound",peer="src",tls="true",errno="ENOTCONN",le="50"} 0
tcp_connection_duration_ms_bucket{direction="inbound",peer="src",tls="true",errno="ENOTCONN",le="100"} 0
tcp_connection_duration_ms_bucket{direction="inbound",peer="src",tls="true",errno="ENOTCONN",le="200"} 0
tcp_connection_duration_ms_bucket{direction="inbound",peer="src",tls="true",errno="ENOTCONN",le="300"} 0
tcp_connection_duration_ms_bucket{direction="inbound",peer="src",tls="true",errno="ENOTCONN",le="400"} 0
tcp_connection_duration_ms_bucket{direction="inbound",peer="src",tls="true",errno="ENOTCONN",le="500"} 0
tcp_connection_duration_ms_bucket{direction="inbound",peer="src",tls="true",errno="ENOTCONN",le="1000"} 0
tcp_connection_duration_ms_bucket{direction="inbound",peer="src",tls="true",errno="ENOTCONN",le="2000"} 0
tcp_connection_duration_ms_bucket{direction="inbound",peer="src",tls="true",errno="ENOTCONN",le="3000"} 0
tcp_connection_duration_ms_bucket{direction="inbound",peer="src",tls="true",errno="ENOTCONN",le="4000"} 0
tcp_connection_duration_ms_bucket{direction="inbound",peer="src",tls="true",errno="ENOTCONN",le="5000"} 0
tcp_connection_duration_ms_bucket{direction="inbound",peer="src",tls="true",errno="ENOTCONN",le="10000"} 0
tcp_connection_duration_ms_bucket{direction="inbound",peer="src",tls="true",errno="ENOTCONN",le="20000"} 0
tcp_connection_duration_ms_bucket{direction="inbound",peer="src",tls="true",errno="ENOTCONN",le="30000"} 1
tcp_connection_duration_ms_bucket{direction="inbound",peer="src",tls="true",errno="ENOTCONN",le="40000"} 1
tcp_connection_duration_ms_bucket{direction="inbound",peer="src",tls="true",errno="ENOTCONN",le="50000"} 1
tcp_connection_duration_ms_bucket{direction="inbound",peer="src",tls="true",errno="ENOTCONN",le="+Inf"} 5
tcp_connection_duration_ms_count{direction="inbound",peer="src",tls="true",errno="ENOTCONN"} 5
tcp_connection_duration_ms_sum{direction="inbound",peer="src",tls="true",errno="ENOTCONN"} 28334607
```
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the tcp_connection_duration metric and its histogram definition in the Linkerd2 repository. Review the sample Prometheus output in this issue, then determine the seconds-based name and bucket ranges; done means connection durations are reported in seconds with a histogram appropriate to their observed scale.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- observability-sre
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 32/100