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 alert LokiMissingLogs #1386

Merged
merged 2 commits into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
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
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

- Alerting rule for Loki missing logs at ingestion

## [4.17.0] - 2024-10-03

### Removed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,3 +171,27 @@ spec:
severity: page
team: atlas
topic: observability
- alert: LokiMissingLogs
annotations:
dashboard: loki-canary/loki-canary
description: This alert checks that loki is not missing canary logs
opsrecipe: loki/
expr: |
(
sum by (cluster_id, pod, installation, pipeline, provider)
(increase(loki_canary_missing_entries_total{cluster_type="management_cluster",namespace="loki"}[5m]))
/
sum by (cluster_id, pod, installation, pipeline, provider)
(increase(loki_canary_entries_total{cluster_type="management_cluster",namespace="loki"}[5m]))
) > 0
for: 30m
labels:
area: platform
cancel_if_cluster_control_plane_unhealthy: "true"
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 @@ -289,3 +289,38 @@ tests:
opsrecipe: "loki#lokicompactorfailedcompaction"
- alertname: LokiCompactorFailedCompaction
eval_time: 300m

# Test for LokiMissingLogs alert
- interval: 1m
input_series:
- series: 'loki_canary_entries_total{app="loki", cluster="loki", cluster_id="grizzly", cluster_type="management_cluster", container="loki-canary", customer="giantswarm", endpoint="http-metrics", installation="grizzly", namespace="loki", pod="loki-canary-5649fbcb65-lkdkq", pipeline="testing", provider="capz", service="loki-canary", service_priority="highest"}'
values: 0+1x1000
- series: 'loki_canary_missing_entries_total{app="loki", cluster="loki", cluster_id="grizzly", cluster_type="management_cluster", container="loki-canary", customer="giantswarm", endpoint="http-metrics", installation="grizzly", namespace="loki", pod="loki-canary-5649fbcb65-lkdkq", pipeline="testing", provider="capz", service="loki-canary", service_priority="highest"}'
values: "0+0x120 0+1x120 120+0x120"
alert_rule_test:
- alertname: LokiMissingLogs
eval_time: 60m
- alertname: LokiMissingLogs
eval_time: 200m
exp_alerts:
- exp_labels:
area: platform
cancel_if_cluster_control_plane_unhealthy: "true"
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: grizzly
installation: "grizzly"
pipeline: "testing"
pod: "loki-canary-5649fbcb65-lkdkq"
provider: "capz"
severity: page
team: atlas
topic: observability
exp_annotations:
dashboard: loki-canary/loki-canary
description: This alert checks that loki is not missing canary logs
opsrecipe: "loki/"
- alertname: LokiMissingLogs
eval_time: 300m