Skip to content

Commit c592ff4

Browse files
committed
Add unit test for new alert
1 parent 4547f1d commit c592ff4

File tree

1 file changed

+17
-0
lines changed
  • operator/internal/manifests/internal/alerts/testdata

1 file changed

+17
-0
lines changed

operator/internal/manifests/internal/alerts/testdata/test.yaml

+17
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ tests:
6363
- series: 'loki_logql_querystats_latency_seconds_bucket{namespace="my-ns", job="querier", route="my-route", le="+Inf"}'
6464
values: '0+100x20'
6565

66+
- series: 'loki_discarded_samples_total{namespace="my-ns", tenant="application", reason="line_too_long"}'
67+
values: '0x5 0+120x25 3000'
68+
6669
alert_rule_test:
6770
- eval_time: 16m
6871
alertname: LokiRequestErrors
@@ -177,3 +180,17 @@ tests:
177180
summary: "The read path has high volume of queries, causing longer response times."
178181
message: "The read path is experiencing high load."
179182
runbook_url: "[[ .RunbookURL ]]#Loki-Read-Path-High-Load"
183+
- eval_time: 22m
184+
alertname: LokiDiscardedSamplesWarning
185+
exp_alerts:
186+
- exp_labels:
187+
namespace: my-ns
188+
tenant: application
189+
severity: warning
190+
reason: line_too_long
191+
exp_annotations:
192+
message: |-
193+
Loki in namespace my-ns is discarding samples in the "application" tenant during ingestion.
194+
Samples are discarded because of "line_too_long" at a rate of 2 samples per second.
195+
summary: Loki is discarding samples during ingestion because they fail validation.
196+
runbook_url: "[[ .RunbookURL]]#Loki-Discarded-Samples-Warning"

0 commit comments

Comments
 (0)