forked from grafana/loki
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add yaml linting step to helm ci (grafana#8822)
**What this PR does / why we need it**: Adds a yaml linting step for the included rules in the loki helm chart. Only way I could think to enforce the comma line ending was to require qutoes around string, otherwise the linter cannot tell if the comma is just part of the string.
- Loading branch information
1 parent
9688f83
commit a4d06ac
Showing
5 changed files
with
71 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.DEFAULT_GOAL := all | ||
.PHONY: lint lint-yaml | ||
|
||
lint: lint-yaml | ||
|
||
lint-yaml: | ||
yamllint -c $(CURDIR)/src/.yamllint.yaml $(CURDIR)/src |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
rules: | ||
quoted-strings: | ||
required: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,53 @@ | ||
--- | ||
groups: | ||
- name: loki_alerts | ||
rules: | ||
- alert: LokiRequestErrors | ||
annotations: | ||
message: | | ||
{{ $labels.job }} {{ $labels.route }} is experiencing {{ printf "%.2f" $value }}% errors. | ||
expr: | | ||
100 * sum(rate(loki_request_duration_seconds_count{status_code=~"5.."}[2m])) by (namespace, job, route) | ||
/ | ||
sum(rate(loki_request_duration_seconds_count[2m])) by (namespace, job, route) | ||
> 10 | ||
for: 15m | ||
labels: | ||
severity: critical | ||
- alert: LokiRequestPanics | ||
annotations: | ||
message: | | ||
{{ $labels.job }} is experiencing {{ printf "%.2f" $value }}% increase of panics. | ||
expr: | | ||
sum(increase(loki_panic_total[10m])) by (namespace, job) > 0 | ||
labels: | ||
severity: critical | ||
- alert: LokiRequestLatency | ||
annotations: | ||
message: | | ||
{{ $labels.job }} {{ $labels.route }} is experiencing {{ printf "%.2f" $value }}s 99th percentile latency. | ||
expr: | | ||
namespace_job_route:loki_request_duration_seconds:99quantile{route!~"(?i).*tail.*"} > 1 | ||
for: 15m | ||
labels: | ||
severity: critical | ||
- alert: LokiTooManyCompactorsRunning | ||
annotations: | ||
message: | | ||
{{ $labels.cluster }} {{ $labels.namespace }} has had {{ printf "%.0f" $value }} compactors running for more than 5m. Only one compactor should run at a time. | ||
expr: | | ||
sum(loki_boltdb_shipper_compactor_running) by (namespace, cluster) > 1 | ||
for: 5m | ||
labels: | ||
severity: warning | ||
- name: 'loki_canaries_alerts' | ||
rules: | ||
- alert: 'LokiCanaryLatency' | ||
annotations: | ||
message: | | ||
{{ $labels.job }} is experiencing {{ printf "%.2f" $value }}s 99th percentile latency. | ||
expr: | | ||
histogram_quantile(0.99, sum(rate(loki_canary_response_latency_seconds_bucket[5m])) by (le, namespace, job)) > 5 | ||
for: '15m' | ||
labels: | ||
severity: 'warning' | ||
- name: "loki_alerts" | ||
rules: | ||
- alert: "LokiRequestErrors" | ||
annotations: | ||
message: | | ||
{{ $labels.job }} {{ $labels.route }} is experiencing {{ printf "%.2f" $value }}% errors. | ||
expr: | | ||
100 * sum(rate(loki_request_duration_seconds_count{status_code=~"5.."}[2m])) by (namespace, job, route) | ||
/ | ||
sum(rate(loki_request_duration_seconds_count[2m])) by (namespace, job, route) | ||
> 10 | ||
for: "15m" | ||
labels: | ||
severity: "critical" | ||
- alert: "LokiRequestPanics" | ||
annotations: | ||
message: | | ||
{{ $labels.job }} is experiencing {{ printf "%.2f" $value }}% increase of panics. | ||
expr: | | ||
sum(increase(loki_panic_total[10m])) by (namespace, job) > 0 | ||
labels: | ||
severity: "critical" | ||
- alert: "LokiRequestLatency" | ||
annotations: | ||
message: | | ||
{{ $labels.job }} {{ $labels.route }} is experiencing {{ printf "%.2f" $value }}s 99th percentile latency. | ||
expr: | | ||
namespace_job_route:loki_request_duration_seconds:99quantile{route!~"(?i).*tail.*"} > 1 | ||
for: "15m" | ||
labels: | ||
severity: "critical" | ||
- alert: "LokiTooManyCompactorsRunning" | ||
annotations: | ||
message: | | ||
{{ $labels.cluster }} {{ $labels.namespace }} has had {{ printf "%.0f" $value }} compactors running for more than 5m. Only one compactor should run at a time. | ||
expr: | | ||
sum(loki_boltdb_shipper_compactor_running) by (namespace, cluster) > 1 | ||
for: "5m" | ||
labels: | ||
severity: "warning" | ||
- name: "loki_canaries_alerts" | ||
rules: | ||
- alert: "LokiCanaryLatency" | ||
annotations: | ||
message: | | ||
{{ $labels.job }} is experiencing {{ printf "%.2f" $value }}s 99th percentile latency. | ||
expr: | | ||
histogram_quantile(0.99, sum(rate(loki_canary_response_latency_seconds_bucket[5m])) by (le, namespace, job)) > 5 | ||
for: "15m" | ||
labels: | ||
severity: "warning" |