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

add new loki compactor failing alert #1375

Merged
merged 12 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- Add `LokiFailedCompaction` alert to know when Loki did not manage to run a successfull compaction in the last 2 hours.

### Changed

- Upgrade Alloy to 0.5.2 which brings no value to this repo.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,22 @@ spec:
severity: page
team: atlas
topic: observability
- name: loki.compactor
rules:
- alert: LokiCompactorFailedCompaction
annotations:
dashboard: loki-retention/loki-retention
description: 'Loki compactor has been failing compactions for more than 2 hours.'
opsrecipe: loki#lokicompactorfailedcompaction
# This alert checks if Loki's the last successful compaction run is older than 2 hours
expr: (time() - loki_compactor_apply_retention_last_successful_run_timestamp_seconds > 60 * 60 * 2)
QuentinBisson marked this conversation as resolved.
Show resolved Hide resolved
for: 1h
labels:
area: platform
cancel_if_cluster_status_creating: "true"
cancel_if_cluster_status_deleting: "true"
cancel_if_cluster_status_updating: "true"
cancel_if_outside_working_hours: "true"
severity: page
team: atlas
topic: observability
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,13 @@ spec:
severity: page
team: atlas
topic: observability
- name: mimir.compactor
rules:
- alert: MimirCompactorFailedCompaction
annotations:
dashboard: 09a5c49e9cdb2f2b24c6d184574a07fd/mimir-compactor-resources
description: 'Mimir compactor has been failing its compactions for 2 hours.'
opsrecipe: mimir/
opsrecipe: mimir#mimircompactorfailedcompaction
# Query is based on the following upstream mixin alerting rule : https://github.com/grafana/mimir/blob/main/operations/mimir-mixin-compiled/alerts.yaml#L858
expr: sum(increase(cortex_compactor_runs_failed_total{reason!="shutdown"}[2h])) by (cluster_id, installation, namespace, pipeline, provider) > 2
labels:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ tests:
input_series:
# mimir-ingester real memory usage gradually decreases until it goes below 30% of the memory requests.
QuentinBisson marked this conversation as resolved.
Show resolved Hide resolved
- series: 'cortex_compactor_runs_failed_total{reason="error", installation="golem", cluster_id="golem", namespace="mimir", pipeline="testing", provider="capa"}'
QuentinBisson marked this conversation as resolved.
Show resolved Hide resolved
values: "8+0x20 1+0x40 0+0x20 4+0x130 0+0x190"
values: "8+0x20 1+0x40 0+0x20 4+0x130 0+0x190"
alert_rule_test:
- alertname: MimirCompactorFailedCompaction
eval_time: 15m
Expand All @@ -415,7 +415,7 @@ tests:
exp_annotations:
dashboard: 09a5c49e9cdb2f2b24c6d184574a07fd/mimir-compactor-resources
description: Mimir compactor has been failing its compactions for 2 hours.
opsrecipe: "mimir/"
opsrecipe: "mimir#mimircompactorfailedcompaction"
- alertname: MimirCompactorFailedCompaction
eval_time: 205m
- alertname: MimirCompactorFailedCompaction
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,3 +227,35 @@ tests:
opsrecipe: loki/
- alertname: LokiHpaReachedMaxReplicas
eval_time: 515m

# Test for LokiCompactorFailedCompaction alert
- interval: 1m
input_series:
- series: 'loki_compactor_apply_retention_last_successful_run_timestamp_seconds{cluster_id="golem", installation="golem", namespace="loki", pipeline="testing", provider="capa"}'
QuentinBisson marked this conversation as resolved.
Show resolved Hide resolved
values: "0x240 14400+60x100" # time() returns eval_time so we return 0 for the first 4 hours and then 14400 (240 minutes) for the next 100 minutes
QuentinBisson marked this conversation as resolved.
Show resolved Hide resolved
alert_rule_test:
- alertname: LokiCompactorFailedCompaction
eval_time: 15m
- alertname: LokiCompactorFailedCompaction
eval_time: 230m
exp_alerts:
- exp_labels:
area: platform
cancel_if_cluster_status_creating: "true"
cancel_if_cluster_status_deleting: "true"
cancel_if_cluster_status_updating: "true"
cancel_if_outside_working_hours: "true"
cluster_id: golem
installation: "golem"
pipeline: "testing"
provider: "capa"
namespace: loki
severity: page
team: atlas
topic: observability
exp_annotations:
dashboard: loki-retention/loki-retention
description: Loki compactor has been failing compactions for more than 2 hours.
opsrecipe: "loki#lokicompactorfailedcompaction"
- alertname: LokiCompactorFailedCompaction
eval_time: 300m