NE-2418: Add haproxy_max_connections metric#728
NE-2418: Add haproxy_max_connections metric#728alebedev87 wants to merge 1 commit intoopenshift:masterfrom
Conversation
|
@alebedev87: This pull request references NE-2418 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set. DetailsIn response to this:
Instructions 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 openshift-eng/jira-lifecycle-plugin repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
176bedf to
8693a02
Compare
Add a new haproxy_max_connections gauge metric that exposes the process-wide maximum connections configured for HAProxy. The metric is extracted from the public frontend's "slim" field (field 6) in HAProxy's "show stat" CSV output. Since the router configures both global and defaults sections with the same ROUTER_MAX_CONNECTIONS value, the public frontend's session limit reflects the process-wide maxconn setting. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
8693a02 to
a0ed627
Compare
|
@alebedev87: all tests passed! Full PR test history. Your PR dashboard. 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. I understand the commands that are listed here. |
|
The new e2e test from CIO is passing. /retitle NE-2418: Add haproxy_max_connections metric |
|
@alebedev87: This pull request references NE-2418 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set. DetailsIn response to this:
Instructions 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 openshift-eng/jira-lifecycle-plugin repository. |
|
@alebedev87: This pull request references NE-2418 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set. DetailsIn response to this:
Instructions 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 openshift-eng/jira-lifecycle-plugin repository. |
|
/assign |
| // The router configures both global and defaults sections with the same ROUTER_MAX_CONNECTIONS value, | ||
| // so the public frontend's limit (field 6/slim) reflects the process-wide maxconn setting. | ||
| // NOTE: If the defaults maxconn is ever configured differently from global maxconn, | ||
| // this approach will no longer accurately represent the process-wide limit. |
There was a problem hiding this comment.
This metric is already available via haproxy_frontend_current_sessions, its just hidden behind this configuration, its missing 6:
router/pkg/router/metrics/haproxy/haproxy.go
Lines 109 to 111 in d8ed355
Also, as you pointed this is a frontend metric. The global one is available via show info, and reading global metrics from there is preferable because it not only provides the correct one, but also provides the current global connections, which is the metric to be tracked along with maxconn to alert users about the availability of their connection limits.

Add a new haproxy_max_connections gauge metric that exposes the process-wide maximum connections configured for HAProxy.
The metric is extracted from the public frontend's "slim" field (field 6) in HAProxy's "show stat" CSV output. Since the router configures both global and defaults sections with the same ROUTER_MAX_CONNECTIONS value, the public frontend's session limit reflects the process-wide maxconn setting.
E2E test: openshift/cluster-ingress-operator#1361.