Skip to content

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

Open
DaanHoogland wants to merge 1 commit into
mainfrom
fix/prometheus-ipv6-normalization
Open

Fix Prometheus exporter not recognizing ::1 as IPv6 loopback#13245
DaanHoogland wants to merge 1 commit into
mainfrom
fix/prometheus-ipv6-normalization

Conversation

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

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 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
Copy link
Copy Markdown

codecov Bot commented May 26, 2026

Codecov Report

❌ Patch coverage is 0% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 18.10%. Comparing base (2ae1015) to head (2feb7d7).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...oudstack/metrics/PrometheusExporterServerImpl.java 0.00% 10 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #13245      +/-   ##
============================================
- Coverage     18.10%   18.10%   -0.01%     
+ Complexity    16749    16748       -1     
============================================
  Files          6037     6037              
  Lines        542957   542965       +8     
  Branches      66487    66487              
============================================
  Hits          98290    98290              
- Misses       433619   433627       +8     
  Partials      11048    11048              
Flag Coverage Δ
uitests 3.51% <ø> (ø)
unittests 19.26% <0.00%> (-0.01%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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
Copy link
Copy Markdown
Contributor

Rubueno commented May 26, 2026

@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

@blueeorangutan package

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.

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

3 participants