Skip to content

Conversation

@cr3ativ3cod3r
Copy link

@cr3ativ3cod3r cr3ativ3cod3r commented Feb 3, 2026

Thank you for contributing to Harbor!

Comprehensive Summary of your change

This PR adds a Prometheus metric to expose remote registry health status.

  • Adds a new collector 'harbor_registry_status'
  • The collector iterates through the registries to get their health status
  • Exposes their health in the /metrics endpoint

Issue being fixed

Fixes #22786

Please indicate you've done the following:

  • Well Written Title and Summary of the PR
  • Label the PR as needed. "release-note/ignore-for-release, release-note/new-feature, release-note/update, release-note/enhancement, release-note/community, release-note/breaking-change, release-note/docs, release-note/infra, release-note/deprecation"
  • Accepted the DCO. Commits without the DCO will delay acceptance.
  • Made sure tests are passing and test coverage is added if needed.
  • Considered the docs impact and opened a new docs issue or PR with docs changes if needed in website repository.

Add a new collector to exporter, which is responsible for health
metrics. The collector will get the registries using List method
of controller. Then iterate through it and get their health
status along with name, url and type.

This exposes registry health to prometheus, enabling operators
to monitor health and also automate alerting.

Signed-off-by: Keerthan KK <tkthulasimandiram@gmail.com>
This commit introduces a set of unit tests for the registry health
collector.

Signed-off-by: Keerthan KK <tkthulasimandiram@gmail.com>
Signed-off-by: Keerthan KK <tkthulasimandiram@gmail.com>
@cr3ativ3cod3r cr3ativ3cod3r changed the title 22786 expose registry health prometheus metrics 22786 expose registry health as prometheus metrics Feb 3, 2026
@cr3ativ3cod3r cr3ativ3cod3r marked this pull request as ready for review February 4, 2026 16:57
@cr3ativ3cod3r cr3ativ3cod3r requested a review from a team as a code owner February 4, 2026 16:57
@codecov
Copy link

codecov bot commented Feb 9, 2026

Codecov Report

❌ Patch coverage is 57.50000% with 17 lines in your changes missing coverage. Please review.
✅ Project coverage is 65.92%. Comparing base (c8c11b4) to head (edcbc77).
⚠️ Report is 667 commits behind head on main.

Files with missing lines Patch % Lines
src/pkg/exporter/registry_collector.go 58.97% 16 Missing ⚠️
src/pkg/exporter/exporter.go 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             main   #22811       +/-   ##
===========================================
+ Coverage   45.36%   65.92%   +20.55%     
===========================================
  Files         244     1075      +831     
  Lines       13333   116451   +103118     
  Branches     2719     2937      +218     
===========================================
+ Hits         6049    76766    +70717     
- Misses       6983    35438    +28455     
- Partials      301     4247     +3946     
Flag Coverage Δ
unittests 65.92% <57.50%> (+20.55%) ⬆️

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

Files with missing lines Coverage Δ
src/pkg/exporter/exporter.go 6.55% <0.00%> (ø)
src/pkg/exporter/registry_collector.go 58.97% <58.97%> (ø)

... and 988 files with indirect coverage changes

🚀 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.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Expose remote registry health status as Prometheus metrics

6 participants