Skip to content

NE-2418: Add haproxy_max_connections metric#728

Open
alebedev87 wants to merge 1 commit intoopenshift:masterfrom
alebedev87:maxconn_metric
Open

NE-2418: Add haproxy_max_connections metric#728
alebedev87 wants to merge 1 commit intoopenshift:masterfrom
alebedev87:maxconn_metric

Conversation

@alebedev87
Copy link
Contributor

@alebedev87 alebedev87 commented Feb 6, 2026

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.

image

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Feb 6, 2026
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Feb 6, 2026

@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.

Details

In response to this:

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.

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 alebedev87 changed the title NE-2418: Add haproxy_max_connections metric [WIP] NE-2418: Add haproxy_max_connections metric Feb 6, 2026
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 6, 2026
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 6, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign rikatz for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

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>
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 6, 2026

@alebedev87: all tests passed!

Full PR test history. Your PR dashboard.

Details

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 kubernetes-sigs/prow repository. I understand the commands that are listed here.

@alebedev87
Copy link
Contributor Author

alebedev87 commented Feb 25, 2026

The new e2e test from CIO is passing.

/retitle NE-2418: Add haproxy_max_connections metric

@openshift-ci openshift-ci bot changed the title [WIP] NE-2418: Add haproxy_max_connections metric NE-2418: Add haproxy_max_connections metric Feb 25, 2026
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 25, 2026
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Feb 25, 2026

@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.

Details

In response to this:

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.

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.

@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Feb 25, 2026

@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.

Details

In response to this:

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.

image

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.

@jcmoraisjr
Copy link
Member

/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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This metric is already available via haproxy_frontend_current_sessions, its just hidden behind this configuration, its missing 6:

// defaultSelectedMetrics is the list of metrics included by default. These metrics are a subset
// of the metrics exposed by haproxy_exporter by default for performance reasons.
var defaultSelectedMetrics = []int{2, 4, 5, 7, 8, 9, 13, 14, 17, 21, 24, 33, 35, 39, 40, 41, 42, 43, 44, 58, 59, 60, 79, 85}

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants