feat(tcp): add praxis_tcp_connection_duration_seconds histogram metric - #1036
Conversation
|
Tool authorship detected:
This project doesn't allow commits which are authored or signed-off by tools. |
bf2a5ab to
64348c0
Compare
praxis-bot
left a comment
There was a problem hiding this comment.
TCP Connection Duration Metric Review
One finding identified in the metric recording coverage.
2162569 to
501476d
Compare
aslakknutsen
left a comment
There was a problem hiding this comment.
sni_timeout and filter_rejection have measurable connection times and will be in connection_close logs, but not recorded as part of histogram.
Intentional?
Would it perhaps make sense to add a label for the connection close type?
Good catch - not intentional, these paths should be recorded too. On the reason label: makes sense. I'll add a reason label with values like completed, sni_timeout, filter_rejection, connect_failure, and peeked_write_error so operators can slice the histogram by close type. |
9aece91 to
bf5d7a8
Compare
|
Worth a mention in praxis/docs/operating/observability.md Line 134 in bf5d7a8 |
bf5d7a8 to
934f454
Compare
Added under ### TCP Connection Metrics section. Also updated the intro to reflect three metric categories. |
praxis-bot
left a comment
There was a problem hiding this comment.
TCP Connection Duration Metric Re-review
One new finding since the previous review. The earlier connect_failure exit path coverage issue appears resolved in the current code.
Head branch was pushed to by a user without write access
5991bb4 to
934f454
Compare
Record TCP connection lifetime (accept to close) as a Prometheus histogram labeled by listener name and close reason. The metric is emitted on all disconnect paths (completed, sni_timeout, filter_rejection, connect_failure, peeked_write_error) and exposed via the admin /metrics endpoint when enabled. Closes praxis-proxy#1027 Signed-off-by: Twinkll Sisodia <tsisodia@redhat.com>
201b364 to
a177efc
Compare
Head branch was pushed to by a user without write access
|
Commit message format: the following commits do not follow conventional commits:
Expected format: |
88d9488 to
f2b988f
Compare
|
Unsigned commits: f2b988f. Please sign your commits. |
Signed-off-by: Twinkll Sisodia <tsisodia@redhat.com>
f2b988f to
8564bea
Compare
Record TCP connection lifetime (accept to close) as a Prometheus histogram labeled by listener name. The metric is emitted on all disconnect paths and exposed via the admin /metrics endpoint when enabled.
What does this PR do?
Adds a
praxis_tcp_connection_duration_secondsPrometheus histogram that records the lifetime of each TCP connection (from accept to close), labeled by listener name. This gives operators visibility into how long TCP connections live across different listeners.Changes:
protocol/src/tcp/metrics.rsmodule withrecord_tcp_connection_duration()PingoraTcpProxy::process_new()listener_label_for()infrastructure for accurate per-listener labelingexamples/configs/observability/tcp-connection-metrics.yamlWhich issue(s) does this relate to?
Fixes #1027
Checklist
git commit -s)make lint && make testpasses locallyDoes this introduce a breaking change?
No. The metric is purely additive and only emitted when the admin interface is enabled.