[speedtest-exporter] fix rules (#1199)

This commit is contained in:
j_r0dd 2021-09-13 12:44:39 -04:00 committed by GitHub
parent 917ae5b927
commit 8af40e02e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 12 deletions

View File

@ -2,7 +2,7 @@ apiVersion: v2
appVersion: v3.2.2
description: Speedtest Exporter made in python using the official speedtest bin
name: speedtest-exporter
version: 5.0.0
version: 5.0.1
kubeVersion: ">=1.16.0-0"
keywords:
- speedtest-exporter

View File

@ -1,6 +1,6 @@
# speedtest-exporter
![Version: 5.0.0](https://img.shields.io/badge/Version-5.0.0-informational?style=flat-square) ![AppVersion: v3.2.2](https://img.shields.io/badge/AppVersion-v3.2.2-informational?style=flat-square)
![Version: 5.0.1](https://img.shields.io/badge/Version-5.0.1-informational?style=flat-square) ![AppVersion: v3.2.2](https://img.shields.io/badge/AppVersion-v3.2.2-informational?style=flat-square)
Speedtest Exporter made in python using the official speedtest bin
@ -87,7 +87,7 @@ N/A
| metrics.prometheusRule.pingLimit | int | `10` | Ping latency you want alerts to be triggered in ms |
| metrics.prometheusRule.rules | list | See prometheusrules.yaml | Configure additionial rules for the chart under this key. |
| metrics.prometheusRule.uploadLimit | int | `400` | Upload speed you want alerts to be triggered in Mbps |
| metrics.serviceMonitor.interval | string | `"1h"` | |
| metrics.serviceMonitor.interval | string | `"60m"` | The interval field must use minutes for the padding to calculate properly. |
| metrics.serviceMonitor.labels | object | `{}` | |
| metrics.serviceMonitor.scrapeTimeout | string | `"1m"` | |
| service | object | See values.yaml | Configures service settings for the chart. |

View File

@ -18,7 +18,7 @@ spec:
summary: Speedtest Exporter is down.
expr: |
absent(up{job=~".*{{ include "common.names.fullname" . }}.*"} == 1)
for: {{ .Values.metrics.serviceMonitor.interval }}
for: {{ trimAll "m" .Values.metrics.serviceMonitor.interval | add 15 }}m
labels:
severity: critical
- alert: SpeedtestSlowInternetDownload
@ -26,7 +26,7 @@ spec:
description: Internet download speed is averaging {{ "{{ humanize $value }}" }} Mbps.
summary: SpeedTest slow internet download.
expr: |
avg_over_time(speedtest_download{job=~".*{{ include "common.names.fullname" . }}.*"}[4h])
avg_over_time(speedtest_download_bits_per_second{job=~".*{{ include "common.names.fullname" . }}.*"}[4h])
< {{ .Values.metrics.prometheusRule.downloadLimit }}
for: 0m
labels:
@ -36,7 +36,7 @@ spec:
description: Internet upload speed is averaging {{ "{{ humanize $value }}" }} Mbps.
summary: SpeedTest slow internet upload.
expr: |
avg_over_time(speedtest_upload{job=~".*{{ include "common.names.fullname" . }}.*"}[4h])
avg_over_time(speedtest_upload_bits_per_second{job=~".*{{ include "common.names.fullname" . }}.*"}[4h])
< {{ .Values.metrics.prometheusRule.uploadLimit }}
for: 0m
labels:
@ -46,7 +46,7 @@ spec:
description: Internet ping latency is averaging {{ "{{ humanize $value }}" }} ms.
summary: SpeedTest high ping latency.
expr: |
avg_over_time(speedtest_ping_latency_milliseconds{job=~".*{{ include "common.names.fullname" . }}.*"}[2h])
avg_over_time(speedtest_ping_latency_milliseconds{job=~".*{{ include "common.names.fullname" . }}.*"}[4h])
> {{ .Values.metrics.prometheusRule.pingLimit }}
for: 0m
labels:
@ -56,7 +56,7 @@ spec:
description: Internet jitter latency is averaging {{ "{{ humanize $value }}" }} ms.
summary: SpeedTest high jitter latency.
expr: |
avg_over_time(speedtest_jitter_latency_milliseconds{job=~".*{{ include "common.names.fullname" . }}.*"}[2h])
avg_over_time(speedtest_jitter_latency_milliseconds{job=~".*{{ include "common.names.fullname" . }}.*"}[4h])
> {{ .Values.metrics.prometheusRule.jitterLimit }}
for: 0m
labels:

View File

@ -36,7 +36,8 @@ metrics:
# @default -- See values.yaml
enabled: false
serviceMonitor:
interval: 1h
# -- The interval field must use minutes for the padding to calculate properly.
interval: 60m
scrapeTimeout: 1m
labels: {}
# -- Enable and configure Prometheus Rules for the chart under this key.
@ -57,11 +58,11 @@ metrics:
rules: []
# - alert: SpeedtestSlowInternetDownload
# annotations:
# description: Internet download speed is averaging {{ humanize $value }} Mbps.
# description: Internet download speed is averaging {{ "{{ humanize $value }}" }} Mbps.
# summary: SpeedTest slow internet download.
# expr: |
# avg_over_time(speedtest_download[4h])
# < 420
# avg_over_time(speedtest_download_bits_per_second{job=~".*{{ include "common.names.fullname" . }}.*"}[4h])
# < {{ .Values.metrics.prometheusRule.downloadLimit }}
# for: 0m
# labels:
# severity: warning