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

update LokiHpaReachedMaxReplicas alert #1342

Merged
merged 3 commits into from
Sep 3, 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]

### Changed

- Updated `LokiHpaReachedMaxReplicas` alert.

## [4.13.1] - 2024-09-03

### Fixed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,18 @@ spec:
annotations:
description: '{{`Loki component {{ $labels.horizontalpodautoscaler }} has reached its maxReplicas number but still needs to be scaled up.`}}'
opsrecipe: loki/
expr: |
sum by (cluster_id, installation, namespace, pipeline, provider, horizontalpodautoscaler) (kube_horizontalpodautoscaler_status_desired_replicas{namespace="loki", horizontalpodautoscaler=~"loki-backend|loki-write|loki-read", cluster_type="management_cluster"})
!=
sum by (cluster_id, installation, namespace, pipeline, provider, horizontalpodautoscaler) (kube_horizontalpodautoscaler_status_current_replicas{namespace="loki", horizontalpodautoscaler=~"loki-backend|loki-write|loki-read", cluster_type="management_cluster"})
expr: |-
(
kube_horizontalpodautoscaler_status_desired_replicas{namespace="loki"} >=
on(cluster_id, customer, installation, namespace, horizontalpodautoscaler)
kube_horizontalpodautoscaler_spec_max_replicas{namespace="loki"}
)
and on(cluster_id, customer, installation, namespace, horizontalpodautoscaler)
(
kube_horizontalpodautoscaler_status_target_metric{namespace="loki"} >
on(cluster_id, customer, installation, namespace, horizontalpodautoscaler, metric_name, metric_target_type)
kube_horizontalpodautoscaler_spec_target_metric{namespace="loki"}
)
for: 4h
labels:
area: platform
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,12 @@ tests:
# loki-backend real memory usage gradually decreases until it goes below 30% of the memory requests.
- series: 'kube_horizontalpodautoscaler_status_desired_replicas{horizontalpodautoscaler="loki-backend", namespace="loki", cluster_type="management_cluster", cluster_id="golem", installation="golem", pipeline="testing", provider="capa", region="eu-west-2"}'
values: "2+0x20 3+0x250 2+0x250"
- series: 'kube_horizontalpodautoscaler_status_current_replicas{horizontalpodautoscaler="loki-backend", namespace="loki", cluster_type="management_cluster", cluster_id="golem", installation="golem", pipeline="testing", provider="capa", region="eu-west-2"}'
- series: 'kube_horizontalpodautoscaler_spec_max_replicas{horizontalpodautoscaler="loki-backend", namespace="loki", cluster_type="management_cluster", cluster_id="golem", installation="golem", pipeline="testing", provider="capa", region="eu-west-2"}'
values: "2+0x520"
- series: 'kube_horizontalpodautoscaler_status_target_metric{horizontalpodautoscaler="loki-backend", namespace="loki", cluster_type="management_cluster", cluster_id="golem", installation="golem", pipeline="testing", provider="capa", region="eu-west-2"}'
values: "60+0x20 120+0x250 60+0x250"
- series: 'kube_horizontalpodautoscaler_spec_target_metric{horizontalpodautoscaler="loki-backend", namespace="loki", cluster_type="management_cluster", cluster_id="golem", installation="golem", pipeline="testing", provider="capa", region="eu-west-2"}'
values: "90+0x520"
alert_rule_test:
- alertname: LokiHpaReachedMaxReplicas
eval_time: 15m
Expand All @@ -218,8 +222,6 @@ tests:
horizontalpodautoscaler: loki-backend
installation: golem
cluster_id: golem
pipeline: testing
provider: capa
exp_annotations:
description: Loki component loki-backend has reached its maxReplicas number but still needs to be scaled up.
opsrecipe: loki/
Expand Down