Skip to content

add VR health checks to prometheus output - #13218

Open
DaanHoogland wants to merge 2 commits into
apache:mainfrom
shapeblue:ghi6212-routerHealthToPrometheus
Open

DaanHoogland wants to merge 2 commits into
apache:mainfrom
shapeblue:ghi6212-routerHealthToPrometheus

Conversation

@DaanHoogland

Copy link
Copy Markdown
Contributor

Description

This PR...

Fixes: #6212

aided by AI

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • Build/CI
  • Test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

How did you try to break this feature and the system with this change?

Copilot AI 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.

Pull request overview

This PR extends the Prometheus exporter plugin to expose Virtual Router health-check results via the /metrics endpoint, addressing the need to monitor VR health checks without per-router API polling (Fixes #6212).

Changes:

  • Collect router health-check results from router_health_check and export per-check status as cloudstack_virtualrouter_healthcheck_result.
  • Export the last update time (Unix epoch seconds) per check as cloudstack_virtualrouter_healthcheck_lastcheck.
  • Wire in the required DAOs (DomainRouterDao, RouterHealthCheckResultDao) and add new metric item types.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov

codecov Bot commented May 22, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 71.64179% with 19 lines in your changes missing coverage. Please review.
✅ Project coverage is 20.77%. Comparing base (d6390bd) to head (9bc4831).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...ud/network/dao/RouterHealthCheckResultDaoImpl.java 0.00% 10 Missing ⚠️
...che/cloudstack/metrics/PrometheusExporterImpl.java 84.21% 6 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##               main   #13218   +/-   ##
=========================================
  Coverage     20.76%   20.77%           
- Complexity    21903    21911    +8     
=========================================
  Files          6496     6496           
  Lines        591612   591679   +67     
  Branches      72585    72594    +9     
=========================================
+ Hits         122851   122909   +58     
- Misses       455424   455430    +6     
- Partials      13337    13340    +3     
Flag Coverage Δ
uitests 3.88% <ø> (ø)
unittests 22.08% <71.64%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@nvazquez

Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@nvazquez a [SL] Jenkins job has been kicked to build packages. It will be bundled with no SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 19820

@nvazquez

nvazquez commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

@nvazquez a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

@blueorangutan

Copy link
Copy Markdown

[SF] Trillian test result (tid-17415)
Environment: kvm-ol8 (x2), zone: Advanced Networking with Mgmt server ol8
Total time taken: 60177 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr13218-t17415-kvm-ol8.zip
Smoke tests completed. 157 look OK, 0 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File

@DaanHoogland
DaanHoogland force-pushed the ghi6212-routerHealthToPrometheus branch from 4aede97 to 9bc4831 Compare November 2, 2026 16:30
Copilot AI balanced review requested due to automatic review settings November 2, 2026 16:30

Copilot AI 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.

🟡 Changes recommended

Duplicate router IDs can trigger an IllegalStateException that aborts metrics collection, skipping zone health checks and domain metrics, so router deduplication and a regression test are needed.

1 open issue
3 resolved since last review

Review effort: Balanced

// only running virtual routers; results of stopped or destroyed routers are stale
Map<Long, DomainRouterVO> runningRouters = routers.stream()
.filter(router -> router.getRole() == VirtualRouter.Role.VIRTUAL_ROUTER && router.getState() == State.Running)
.collect(Collectors.toMap(DomainRouterVO::getId, router -> router));

This branch has not been deployed

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

Projects

Status: Ready

Development

Successfully merging this pull request may close these issues.

Export Virtual Router Health Checks to Prometheus

6 participants