ci / lint (push) Skipped
ci / test (push) Skipped
ci / build (push) Skipped
ci / image (push) Skipped
ci / lint (pull_request) Successful in 11m57s
ci / test (pull_request) Successful in 13m1s
ci / build (pull_request) Successful in 19m25s
ci / image (pull_request) Successful in 6m9s
uptimesebi_checks_overdue counted only runs not dispatched yet. Dispatch hands due runs to an instance's queue and schedules the next run at once, so a checker too busy to take its work left the metric at 0. It now also counts queued runs due more than 10 seconds ago. The chart adds an optional PrometheusRule (api.metrics.prometheusRule): UptimeSebiRegionBehind fires when a region's checks stay overdue, and UptimeSebiPlatformMetricsFailing when the platform metrics cannot be read. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
40 lines
1.5 KiB
YAML
40 lines
1.5 KiB
YAML
{{- if and .Values.api.metrics.enabled .Values.api.metrics.prometheusRule.enabled }}
|
|
{{- $rule := .Values.api.metrics.prometheusRule }}
|
|
apiVersion: monitoring.coreos.com/v1
|
|
kind: PrometheusRule
|
|
metadata:
|
|
name: {{ include "uptimesebi.fullname" . }}-api
|
|
labels:
|
|
{{- include "uptimesebi.labels" . | nindent 4 }}
|
|
app.kubernetes.io/component: api
|
|
{{- with $rule.labels }}
|
|
{{- toYaml . | nindent 4 }}
|
|
{{- end }}
|
|
spec:
|
|
groups:
|
|
- name: uptimesebi
|
|
rules:
|
|
# Every replica reports the same platform values, hence max().
|
|
- alert: UptimeSebiRegionBehind
|
|
expr: max by (region) (uptimesebi_checks_overdue) > 0
|
|
for: {{ $rule.regionBehindFor }}
|
|
labels:
|
|
severity: {{ $rule.severity }}
|
|
annotations:
|
|
summary: "Region {{ "{{ $labels.region }}" }} falls behind its checks"
|
|
description: >-
|
|
{{ "{{ $value }}" }} checks of region {{ "{{ $labels.region }}" }} are more than
|
|
10 seconds overdue: no checker of the region is live, or its
|
|
checkers cannot take the work in time.
|
|
- alert: UptimeSebiPlatformMetricsFailing
|
|
expr: max(uptimesebi_platform_metrics_error) > 0
|
|
for: 10m
|
|
labels:
|
|
severity: {{ $rule.severity }}
|
|
annotations:
|
|
summary: UptimeSebi cannot read its platform metrics
|
|
description: >-
|
|
The API fails to read the database or Redis for its platform
|
|
metrics, so UptimeSebiRegionBehind sees stale values.
|
|
{{- end }}
|