Skip to content

Add per_server.connection metrics - #12250

Merged
serrislew merged 3 commits into
apache:masterfrom
serrislew:per_server_metrics
Jun 3, 2025
Merged

Add per_server.connection metrics#12250
serrislew merged 3 commits into
apache:masterfrom
serrislew:per_server_metrics

Conversation

@serrislew

Copy link
Copy Markdown
Contributor

Add following metrics for origin server connections. Follows connection.match rules and appends it as a suffix in the metric name

  • total_connections: count
  • active_connections: gauge, replaces _count when enabled to keep blocking and metrics consistent
  • blocked_connections: count to measure the blocked connections

configured with metric_enabled and metric_prefix

Also adds port to proxy.config.http.per_server.connection.match as it is in matching

@serrislew serrislew added this to the 10.2.0 milestone May 20, 2025
@serrislew serrislew self-assigned this May 20, 2025

@bneradt bneradt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks interesting.

Comment thread include/iocore/net/ConnectionTracker.h Outdated
@serrislew
serrislew requested a review from bneradt May 21, 2025 13:54
@serrislew
serrislew force-pushed the per_server_metrics branch from a264a60 to 3fc0ae4 Compare June 3, 2025 05:59
,
{RECT_CONFIG, "proxy.config.http.per_server.connection.max", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.per_server.connection.match", RECD_STRING, "both", RECU_DYNAMIC, RR_NULL, RECC_STR, "^(?:ip|host|both|none)$", RECA_NULL}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The match type shows "port" but not "none". Was this intentional?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think you're right that this must have been missed. Clearly port is supported, looking at the implementation's set of supported tags:

const std::array<std::string_view, static_cast<int>(ConnectionTracker::MATCH_BOTH) + 1> ConnectionTracker::MATCH_TYPE_NAME{
{"ip"sv, "port"sv, "host"sv, "both"sv}
};

@serrislew
serrislew merged commit 218e736 into apache:master Jun 3, 2025
@github-project-automation github-project-automation Bot moved this to For v10.1.0 in ATS v10.1.x Jun 3, 2025
@cmcfarlen cmcfarlen removed this from the 10.2.0 milestone Jun 3, 2025
@cmcfarlen cmcfarlen moved this from For v10.1.0 to picked v10.1.0 in ATS v10.1.x Jun 3, 2025
@cmcfarlen cmcfarlen moved this from picked v10.1.0 to Done in ATS v10.1.x Jun 3, 2025
@cmcfarlen

Copy link
Copy Markdown
Contributor

This PR was added to the 10.1.x branch by #12269

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

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants