Skip to content

Added a prometheus alert rule for unreachable target#1778

Merged
aayushchouhan09 merged 1 commit intonoobaa:masterfrom
aayushchouhan09:targ-alert
Jan 27, 2026
Merged

Added a prometheus alert rule for unreachable target#1778
aayushchouhan09 merged 1 commit intonoobaa:masterfrom
aayushchouhan09:targ-alert

Conversation

@aayushchouhan09
Copy link
Member

@aayushchouhan09 aayushchouhan09 commented Jan 19, 2026

Explain the changes

  1. Added an alert rule for unreachable target.

Issues: Fixed #xxx / Gap #xxx

  1. JIRA: https://issues.redhat.com/browse/RHSTOR-8110
  2. Core PR: Exporting replication_target_status metric to use in prometheus alert noobaa-core#9385

Testing Instructions:

  1. Create obc with the replication policy (also try with namespacestore):

aayush:noobaa-operator$ cat policy.json
{ "rules": [{"rule_id": "rule-2", "destination_bucket": "<target_bucket>", "filter": {"prefix": ""}}]}
aayush:noobaa-operator$ nb obc create aayush2-obc --replication-policy ./policy.json

  1. Check if objects are replicated to the target bucket.
  2. Now delete the target bucket and its objects --> try to put the target bucket in unreachable state (by deleting bucket, deleting source bucket from aws/azure for namespacestore, etc.)
  3. Enable prometheus dashboard using below commands and execute url localhost:9090 in the browser:

helm install prometheus prometheus-community/kube-prometheus-stack
put labels release: prometheus —> for ServiceMonitor and PrometheusRules
kubectl port-forward --namespace='default' prometheus-prometheus-kube-prometheus-prometheus-0 9090

  1. Check for the NooBaaReplicationTargetUnreachable alert, also you can verify the metric value NooBaa_replication_target_status=0 (for unreachable)
  • Doc added/updated
  • Tests added

Summary by CodeRabbit

  • New Features
    • Added alerting for unreachable replication targets. The system will now raise a warning when a replication target becomes inaccessible for 5 minutes or more, including descriptive notifications to help identify the affected source and target buckets and the storage type.

✏️ Tip: You can customize this high-level summary in your review settings.

@aayushchouhan09 aayushchouhan09 requested review from a team, Neon-White, alphaprinz and liranmauda and removed request for a team January 19, 2026 17:34
@coderabbitai
Copy link

coderabbitai bot commented Jan 19, 2026

📝 Walkthrough

Walkthrough

Adds a new Prometheus alert rule NooBaaReplicationTargetUnreachable to detect unreachable NooBaa replication targets (expr checks replication target status == 0, for 5m) and updates the embedded prometheus-rules YAML SHA256 constant in the bundle code.

Changes

Cohort / File(s) Summary
Prometheus Rules Configuration
deploy/internal/prometheus-rules.yaml
Added NooBaaReplicationTargetUnreachable alert under noobaa-replication.rules with expr: NooBaa_replication_target_status{source_bucket=~".+", target_bucket=~".+"} == 0, for: 5m, warning severity label and annotations (description, message, severity_level, storage_type).
Bundle Deployment
pkg/bundle/deploy.go
Updated embedded YAML SHA256 constant for deploy/internal/prometheus-rules.yaml from 0e1a0f98c403cfc5b6f0e6e1cc5513f18ff7cdfbc5581591869366a824a90b71 to 800f793fa04b150c026febedfb4042d7919ac9a5c058a9f2a244fcbccc9bfcf9.

Sequence Diagram(s)

(omitted — changes are configuration + embedded-hash update without multi-component control-flow changes)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested labels

size/S

Suggested reviewers

  • liranmauda
  • tangledbytes
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Added a prometheus alert rule for unreachable target' accurately describes the main change: adding a new Prometheus alert rule (NooBaaReplicationTargetUnreachable) for detecting unreachable replication targets.
Description check ✅ Passed The description follows the template structure with 'Explain the changes', 'Issues', and 'Testing Instructions' sections, providing specific details about the alert rule addition, related JIRA ticket, and comprehensive testing steps.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Signed-off-by: Aayush Chouhan <achouhan@redhat.com>
@aayushchouhan09 aayushchouhan09 merged commit ca80ffe into noobaa:master Jan 27, 2026
15 checks passed
@aayushchouhan09 aayushchouhan09 deleted the targ-alert branch January 27, 2026 08:02
@coderabbitai coderabbitai bot mentioned this pull request Feb 3, 2026
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants