SearchAPI and Opensearch alerts and monitoring
As described in GOV.UK Search: How it works there are two search stacks on GOV.UK. This page includes information on the monitoring and alerting for Search API and its Opensearch cluster.
Dashboard
The GOV.UK Search API v1 Grafana dashboard visualizes core metrics for Search API and Finder Frontend.
Alert types and how to handle them
Search API success rate and latency alerts
We monitor and alert on Search API success rates. There are currently two Alertmanager rules configured in govuk-helm-charts to send notifications on Slack:
SearchApiSearchSuccessRateDegradedAcute (Critical) 5 minute rolling success rate for search requests to search-api has dropped below 99%.
SearchApiSearchSuccessRateDegradedMid (Critical) 1 hour rolling success rate for search requests to search-api has dropped below 99.9%.
Refinement of these alerts (to make sure they are comprehensively covering relevant errors) and further alerting has been prioritised by the Search Team for Q3 26/27.
Possible causes and steps to take in the event of a critical alert being triggered
- If search-api has recently been deployed and is returning errors, it may require a rollback.
- Search-api is heavily dependent on OpenSearch. If search-api is showing a high number of errors, it could indicate an issue with the OpenSearch cluster health, or a disk space issue. See the Opensearch alerts runbook for debugging steps.
- For further diagnosis of issues, check the issue reports in Sentry and/or the logs in Kibana.
Opensearch alerts
We monitor and alert on Opensearch health. We have the following alerts configured:
SearchApiOpensearchClusterStatusRed (Critical) cluster status is RED for 5 minutes
SearchApiOpensearchClusterStatusUnkUnav (Critical) cluster status is UNKNOWN or UNAVAILABLE for 5 minutes
SearchApiOpensearchClusterStatusYellow (Warning) cluster status is YELLOW for 30 minutes
SearchApiOpensearchDiskSpace (Critical) disk space has dropped below 10% for 10 minutes
SearchApiOpensearchDiskSpace (Warning) disk space has dropped below 30% for 10 minutes
Possible causes and steps to take in the event of an opensearch alert being triggered
Check the Opensearch cluster status panel on the GOV.UK Search API V1 grafana dashboard to see the cluster status history. See Opensearch Cluster Health for steps to take in the event that an SearchApiOpensearchClusterStatus alert fires.
If a disk space alert fires then we are running out of EBS storage.
- Check the Opensearch - Percent disk space free Grafana dashboard panel to see if this is just a blip or if we’re genuinely running out of space
- If there’s been a sudden drop in free disk space investigate where the documents have come from:
- have they been added in error?
- can they be removed?
- If we’re running out of storage you can increase the capacity of the EBS volume by adjusting the opensearch variables in terraform.
Monitoring and alerting tools
Sentry
Sentry is set up to track application errors from Search API.
All environments are configured for Slack notifications. Production alerts are routed to #govuk-search-alerts, while alerts for other environments are sent to #govuk-search-alerts-nonprod.
Kibana
Kibana can be used to query application logs as per all other GOV.UK apps.
Grafana
The GOV.UK Search API v1 Grafana dashboard visualizes core metrics for Search API and Finder Frontend.