-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add status check for Harbor's read-only status #6917
Add status check for Harbor's read-only status #6917
Conversation
harbor/assets/service_checks.json
Outdated
{ | ||
"agent_version": "6.13.0", | ||
"integration": "Harbor", | ||
"groups": [ | ||
"host", | ||
"registry" | ||
], | ||
"check": "harbor.read_only", | ||
"statuses": [ | ||
"ok", | ||
"unknown", | ||
"critical" | ||
], | ||
"name": "Is Harbor in read_only mode", | ||
"description": "Returns `OK` if the registry is not in `read_only` mode, otherwise returns `CRITICAL`. Monitors if the registry is in read_only mode or not." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't know if I should modify this. I can remove it if necessary
Codecov Report
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 docs
4b2c67b
to
ee084b2
Compare
Hi @bksteiny and thanks for your PR 👍 The use case really makes sense to me but for exactly the arguments you mentioned, I think this information should really be a gauge metric instead of a service check. Can you update the PR to re-submit it as a gauge and we can then look into the details for the tests to pass? |
ee084b2
to
d303deb
Compare
Hi @FlorianVeaux, I've pushed my changes that collect the read-only status as a gauge metric. Thanks for the assist |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a few comments 👍
Can you also add the metric to the metadata.csv file?
Thanks @bksteiny |
What does this PR do?
This adds a status check to monitor whether or not Harbor is in a system-wide read-only mode.
Motivation
I added this check because we've had a few occurrences where Harbor has gone into a read-only mode and we haven't been able to figure out why. This is especially a problem if you're replicating to 1 or many instances, and replication stops because a registry has gone into read-only mode.
Additional Notes
The Harbor API returns a boolean for the
read_only
status. I originally wanted to submit this data as a gauge (True = 1, False =0), however I wasn't able to get the tests to pass on Harbor version 1.4 (the read_only status isn't available in that version of Harbor).Here are the reasons why I wanted to collect this as a gauge:
Review checklist (to be filled by reviewers)
changelog/
andintegration/
labels attached