Skip to content

Conversation

@johha
Copy link
Contributor

@johha johha commented Jan 13, 2026

This change allows the export of database connection pool metrics and vital metrics for the cloud_controller_clock and cc_deployment_updater processes via prometheus.

This required some bigger changes:

Metrics Infrastructure

  • Add ExecutionContext class to manage process type identification and rake context setup across all CAPI processes
  • Add StandaloneMetricsWebserver for non-API processes (clock, deployment_updater, cc-worker) with automatic TLS configuration
  • Refactor PrometheusUpdater to register metrics based on execution context, avoiding unnecessary metric registration
  • Consolidate PrometheusUpdater instances (remove separate cc_worker_prometheus_updater)

Clock & Deployment Updater Configuration:

  • Add publish_metrics config option to enable/disable metrics publishing
  • Add prometheus_port config option (default: 9394 for clock, 9395 for deployment_updater)
  • Initialize metrics webserver and periodic vital updates when metrics publishing is enabled

Metric Improvements:

  • Add process_type and pid labels to vital metrics for process identification
  • Add process_type label to DB connection pool metrics
  • Refactor PeriodicUpdater to support configurable task lists (enables vitals-only updates for clock, deployment_updater, cc-worker)

Code Organization

  • Rename MetricsWebserver to ApiMetricsWebserver for clarity
  • Update all rake tasks to set execution context via ExecutionContext API
  • Update DB connection metrics initialization to use ExecutionContext
  • Update existing specs to work with new execution context

Links to any other associated PRs

  • CAPI PR WIP
  • I have reviewed the contributing guide

  • I have viewed, signed, and submitted the Contributor License Agreement

  • I have made this pull request to the main branch

  • I have run all the unit tests using bundle exec rake

  • I have run CF Acceptance Tests

@johha johha force-pushed the clock-deployment_updater-metrics branch 2 times, most recently from f87b5f0 to d98d35c Compare January 14, 2026 12:38
@johha johha marked this pull request as ready for review January 15, 2026 07:44
This change allows the export of database connection pool metrics and vital metrics
for the `cloud_controller_clock` and `cc_deployment_updater` processes via prometheus.

This required some bigger changes:

- Metrics Infrastructure:
  - Add `ExecutionContext` class to manage process type identification and rake context setup across all CAPI processes
  - Add `StandaloneMetricsWebserver` for non-API processes (clock, deployment_updater, cc-worker) with automatic TLS configuration
  - Refactor `PrometheusUpdater` to register metrics based on execution context, avoiding unnecessary metric registration
  - Consolidate `PrometheusUpdater` instances (remove separate `cc_worker_prometheus_updater`)

- Clock & Deployment Updater Configuration:
  - Add `publish_metrics` config option to enable/disable metrics publishing
  - Add `prometheus_port` config option (default: 9394 for clock, 9395 for deployment_updater)
  - Initialize metrics webserver and periodic vital updates when metrics publishing is enabled

- Metric Improvements:
  - Refactor `PeriodicUpdater` to support configurable task lists (enables vitals-only updates for clock, deployment_updater, cc-worker)

- Code Organization
  - Rename `MetricsWebserver` to `ApiMetricsWebserver` for clarity
  - Update all rake tasks to set execution context via `ExecutionContext` API
  - Update DB connection metrics initialization to use `ExecutionContext`
  - Update existing specs to work with new execution context
@johha johha force-pushed the clock-deployment_updater-metrics branch from d98d35c to 3e1646d Compare January 15, 2026 09:40
@johha johha merged commit 9c9a9d5 into main Jan 16, 2026
11 checks passed
ari-wg-gitbot added a commit to cloudfoundry/capi-release that referenced this pull request Jan 16, 2026
Changes in cloud_controller_ng:

- Add db and vital metrics for clock and deployment_updater
    PR: cloudfoundry/cloud_controller_ng#4749
    Author: Johannes Haass <[email protected]>
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