mirror of https://github.com/grafana/loki
Add yaml linting step to helm ci (#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.pull/8600/head^2
parent
9688f83954
commit
a4d06acca7
@ -0,0 +1,7 @@ |
||||
.DEFAULT_GOAL := all
|
||||
.PHONY: lint lint-yaml |
||||
|
||||
lint: lint-yaml |
||||
|
||||
lint-yaml: |
||||
yamllint -c $(CURDIR)/src/.yamllint.yaml $(CURDIR)/src
|
@ -0,0 +1,4 @@ |
||||
--- |
||||
rules: |
||||
quoted-strings: |
||||
required: true |
@ -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" |
||||
|
Loading…
Reference in new issue