Skip to content

statsmanager: allow multiple instances to share a prometheus server - #48431

Merged
jkarneges merged 4 commits into
mainfrom
jkarneges/statsmanager-shared-prom
Sep 12, 2026
Merged

statsmanager: allow multiple instances to share a prometheus server#48431
jkarneges merged 4 commits into
mainfrom
jkarneges/statsmanager-shared-prom

Conversation

@jkarneges

Copy link
Copy Markdown
Member

This does a few things:

  • PrometheusServer and CommonMetrics constructions are moved outside of StatsManager.
  • A shared_ptr<CommonMetrics> is passed to each StatsManager instance. Notably, StatsManager no longer needs awareness of PrometheusServer.
  • Each StatsManager instance registers with the supplied CommonMetrics instance, and then identifies itself when calling CommonMetrics::update. This is needed to allow per-instance bookkeeping of "previous" values.

The connection_connected gauge is maintained as an aggregate by applying potentially negative deltas and by subtracting on unregistration.

Tested locally, by setting proxy workers=2, confirming different workers performing work, and then confirming the single prometheus server returning aggregate results.

@jkarneges
jkarneges requested a review from a team September 12, 2026 01:05
@jkarneges
jkarneges merged commit b3ae844 into main Sep 12, 2026
21 checks passed
@jkarneges
jkarneges deleted the jkarneges/statsmanager-shared-prom branch September 12, 2026 01:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants