Skip to content

Fix Prometheus exporter not recognizing ::1 as IPv6 loopback - #13245

Open
DaanHoogland wants to merge 2 commits into
mainfrom
fix/prometheus-ipv6-normalization
Open

DaanHoogland wants to merge 2 commits into
mainfrom
fix/prometheus-ipv6-normalization

Conversation

@DaanHoogland

@DaanHoogland DaanHoogland commented May 26, 2026 •

Copy link
Copy Markdown
Contributor

Normalize IPv6 addresses using InetAddress.getHostAddress() so that compressed forms like ::1 and full forms like 0:0:0:0:0:0:0:1 are treated as equivalent when checking the allowed IPs list.

Fixes #6714

(claude assisted fix)

Description

This PR...

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?

@DaanHoogland
DaanHoogland requested review from NuxRo and Copilot May 26, 2026 10:50
@DaanHoogland

Copy link
Copy Markdown
Contributor Author

@Rubueno , you care to test this?

@codecov

codecov Bot commented May 26, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 57.14286% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 20.77%. Comparing base (41e3062) to head (3b3ebbb).

Files with missing lines Patch % Lines
...oudstack/metrics/PrometheusExporterServerImpl.java 57.14% 12 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##              main   #13245       +/-   ##
============================================
+ Coverage     3.88%   20.77%   +16.89%     
- Complexity       0    21912    +21912     
============================================
  Files          493     6496     +6003     
  Lines        42571   591655   +549084     
  Branches      8069    72591    +64522     
============================================
+ Hits          1653   122918   +121265     
- Misses       40687   455399   +414712     
- Partials       231    13338    +13107     
Flag Coverage Δ
uitests 3.88% <ø> (ø)
unittests 22.08% <57.14%> (?)

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.

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@Rubueno

Rubueno commented May 26, 2026

Copy link
Copy Markdown
Contributor

@Rubueno , you care to test this?

I don't have a test env available right now, but reducing the change to a very minimal compiled program seems to render the expected output

Thanks Daan!

@DaanHoogland

Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@DaanHoogland DaanHoogland moved this from Backlog to Ready in CloudStack Testing Aug 31, 2026
@blueorangutan

Copy link
Copy Markdown

@DaanHoogland 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 19028

@DaanHoogland

Copy link
Copy Markdown
Contributor Author

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

@DaanHoogland 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-16856)
Environment: kvm-ol8 (x2), zone: Advanced Networking with Mgmt server ol8
Total time taken: 60846 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr13245-t16856-kvm-ol8.zip
Smoke tests completed. 155 look OK, 1 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_02_list_cpvm_vm Failure 0.06 test_ssvm.py
test_04_cpvm_internals Failure 0.07 test_ssvm.py

@DaanHoogland
DaanHoogland force-pushed the fix/prometheus-ipv6-normalization branch from 2feb7d7 to 75cd233 Compare November 2, 2026 11:26
Copilot AI balanced review requested due to automatic review settings November 2, 2026 11:26
@DaanHoogland

Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

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

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.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

3 open issues

Review effort: Lite

@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

🔴 Test Coverage Grade: D — Marginal

Metric Value
Line coverage 25.88%
Branch coverage 20.20%

Grade Scale

Grade Line Coverage Meaning
🟢 A ≥ 80% Excellent - this code sleeps well at night 😴
🟡 B 60-79% Good - almost there, don't stop now 😉
🟠 C 40-59% Acceptable - your code is wearing a seatbelt, but no airbags 😬
🔴 D 20-39% Marginal - boldly shipping where no test has gone before 🖖
⛔ F < 20% Failing - tests? what tests? 🔥

Branch coverage is shown as a secondary signal. Grade is determined by line coverage.
View full Actions run

@blueorangutan

Copy link
Copy Markdown

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

DaanHoogland and others added 2 commits November 3, 2026 15:26
Normalize IPv6 addresses using InetAddress.getHostAddress() so that
compressed forms like ::1 and full forms like 0:0:0:0:0:0:0:1 are
treated as equivalent when checking the allowed IPs list.

Fixes #6714
@DaanHoogland
DaanHoogland force-pushed the fix/prometheus-ipv6-normalization branch from 75cd233 to 3b3ebbb Compare November 3, 2026 14:34
Copilot AI balanced review requested due to automatic review settings November 3, 2026 14:34

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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@DaanHoogland

Copy link
Copy Markdown
Contributor Author

@nvazquez as seen in #13245 (comment), the logic was tested. I think this can merge with a review .. cc @NuxRo ;) ;)

@nvazquez nvazquez modified the milestones: 4.22.2, 24.0 Nov 3, 2026
@sonarqubecloud

sonarqubecloud Bot commented Nov 3, 2026

Copy link
Copy Markdown

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.

Prometheus exporter - interpret ::1 as 0:0:0:0:0:0:0:1

6 participants