Add connection_duration_seconds histogram for post-dial connection lifespan - #899
Conversation
…fespan Operators lack visibility into how long proxied connections stay open end-to-end once established, making it hard to reason about connection churn or spot abnormally short-lived sessions. Track the established timestamp on ProxyClientConnection and observe the elapsed duration on every removal path (normal close and backend-conn cleanup), mirroring the existing dial_failure_count/reason instrumentation pattern. Addresses one item of the checklist in kubernetes-sigs#410.
|
Welcome @HarnageaGabriel! |
|
Hi @HarnageaGabriel. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
/ok-to-test |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cheftako, HarnageaGabriel The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Summary
connection_duration_secondsPrometheus histogram (buckets 1s–24h) tracking how long a proxied end-to-end connection stays established (post-dial) before it closes.ProxyClientConnectionand observes the duration on both removal paths (removeEstablished,removeEstablishedForBackendConn), mirroring the existingdial_failure_count/reason instrumentation style.Addresses one item of the checklist in #410 ("Connection lifespan (histogram)").
Test plan
go build ./...go test ./pkg/server/...(68 tests pass, includes newTestConnectionDurationMetric)🤖 Generated with Claude Code