Skip to content
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

Fix rejection ratio alert #508

Merged
merged 2 commits into from
Nov 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions src/alert_rules/prometheus/prometheus_alerts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@
- "name": "opensearch.alerts"
"rules":

# Write requests rates
# =====================
- record: write:rejected_requests:rate2m
expr: sum by (cluster, instance, node) (rate(opensearch_threadpool_threads_count{name="write", type="rejected"}[2m]))

- record: write:total_requests:rate2m
expr: sum by (cluster, instance, node) (rate(opensearch_threadpool_threads_count{name="write"}[2m]))

# If there are no write rejections then we get can 0/0 which is NaN. This does not affect the
# OpenSearchWriteRequestsRejectionJumps alert
- record: write:reject_ratio:rate2m
expr: write:rejected_requests:rate2m / write:total_requests:rate2m

- "alert": "OpenSearchScrapeFailed"
"annotations":
"message": "Scrape on {{ $labels.juju_unit }} failed. Ensure that the OpenSearch systemd service is healthy and that the unit is part of the cluster."
Expand Down Expand Up @@ -32,12 +45,12 @@
"labels":
"severity": "warning"

- "alert": "OpenSearchBulkRequestsRejectionJumps"
- "alert": "OpenSearchWriteRequestsRejectionJumps"
"annotations":
"message": "High Bulk Rejection Ratio at {{ $labels.node }} node in {{ $labels.cluster }} cluster. This node may not be keeping up with the indexing speed."
"summary": "High Bulk Rejection Ratio - {{ $value }}%"
"message": "High Write Rejection Ratio at {{ $labels.node }} node in {{ $labels.cluster }} cluster. This node may not be keeping up with the indexing speed."
"summary": "High Write Rejection Ratio - {{ $value }}%"
"expr": |
round( bulk:reject_ratio:rate2m * 100, 0.001 ) > 5
round( write:reject_ratio:rate2m * 100, 0.001 ) > 5
"for": "10m"
"labels":
"severity": "warning"
Expand Down
Loading