Skip to content

Add alerts for high 5xx error rates - #1168

Open
amar-gds-ndl wants to merge 3 commits into
mainfrom
feature/DGUK-5xx-error-alerting
Open

Add alerts for high 5xx error rates#1168
amar-gds-ndl wants to merge 3 commits into
mainfrom
feature/DGUK-5xx-error-alerting

Conversation

@amar-gds-ndl

@amar-gds-ndl amar-gds-ndl commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Added alert rules to watch for 5xx errors on the main data.gov.uk services.

We don't have automatic alerts when services start returning errors. We need to know right away when something breaks.

The following are changed:

I have now added alert rules that watch 5xx errors:

  • CKAN service
  • Find service
  • Datagovuk app

Alert rules

When 5xx error rate goes over 20% and stays there for 5 minutes = sends warning alert

When 5xx error rate goes over 50% and stays there for 2 minutes = sends critical alert

This way we catch problems early.

Uses Prometheus to count errors every 30 seconds. If threshold is hit, alert fires.

…izing

Fixes harvest-gather crash-loop by increasing memory limits:
- Production: 1Gi → 3Gi memory limit, 512Mi → 1Gi requests, 250m → 500m CPU requests
- Integration: 1Gi → 2Gi memory limit, 512Mi → 1Gi requests, 250m → 500m CPU requests
- Staging: 1Gi → 2Gi memory limit, 512Mi → 1Gi requests, 250m → 500m CPU requests

Health probes already enabled on all environments. This addresses the underlying
resource exhaustion causing 116+ restarts since April 2nd.
Implements PrometheusRule resources for monitoring 5xx error rates:
- CKAN (ckan.rules): Alert when 5xx rate > 20% for 5m (warning), > 50% for 2m (critical)
- Datagovuk find (datagovuk-find.rules): Alert when 5xx rate > 20% for 5m (warning), > 50% for 2m (critical)
- Datagovuk app (datagovuk-app.rules): Alert when 5xx rate > 20% for 5m (warning), > 50% for 2m (critical)

Alerts are evaluated every 30 seconds and will fire when thresholds are exceeded.
Severity levels: warning for > 20%, critical for > 50%.
@amar-gds-ndl
amar-gds-ndl requested review from a team as code owners August 14, 2026 10:35
Removed helm template variables from string annotations that were causing linting errors.
Changed description fields to use static text instead of template rendering.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant