Skip to content

Openverse is a search engine for openly-licensed media. This monorepo includes all application code.

Add log insights querying information for Nuxt 5XX errors (#4012)

Madison Swain-Bowden95da05b50be4
diff --git a/documentation/meta/monitoring/runbooks/nuxt_http_5xx_above_threshold.md b/documentation/meta/monitoring/runbooks/nuxt_http_5xx_above_threshold.md
index ebdc3b668..6bc5107e5 100644
--- a/documentation/meta/monitoring/runbooks/nuxt_http_5xx_above_threshold.md
+++ b/documentation/meta/monitoring/runbooks/nuxt_http_5xx_above_threshold.md
@@ -5,6 +5,7 @@ Status: **Stable**
Alarm link:
- [Alarm details](https://us-east-1.console.aws.amazon.com/cloudwatch/home?region=us-east-1#alarmsV2:alarm/Nuxt+Production+HTTP+5XX+responses+count+over+threshold)
+- [Nuxt Production log group][log_group]
- [ECS-Production-Dashboard](https://us-east-1.console.aws.amazon.com/cloudwatch/home?region=us-east-1#dashboards/dashboard/ECS-Production-Dashboard)
```
@@ -25,10 +26,36 @@ errors (this can be checked by observing paths in the Cloudflare logs).
investigation into the API side is warranted to determine the cause for the
5XX responses. Also refer to the
[API 5XX runbook](/meta/monitoring/runbooks/api_http_5xx_above_threshold.md).
+- To gather more information check the [log group][log_group], use the "Logs
+ Insights" view to query for requests that failed using a CloudWatch query
+ similar to the following which can give more hints about where is the problem.
+
+```
+fields request, @timestamp, @message
+| filter status >= 500
+| sort @timestamp desc
+| limit 20
+```
+
+- Occasionally, we'll observe a high number of 5XX responses on the `/api/event`
+ endpoint. These are often the result of outages or issues with Plausible and
+ are not actionable for us. The following Log Insights query can be helpful in
+ determining the source of the 500s based on the endpoints.
+
+```
+fields request, @timestamp, @message
+| filter status >= 500
+| sort @timestamp desc
+| stats count(*) by request
+```
+
+[log_group]:
+ https://us-east-1.console.aws.amazon.com/cloudwatch/home?region=us-east-1#logsV2:log-groups/log-group/$252Fecs$252Fproduction$252Ffrontend
## Historical false positives
-Nothing registered to date.
+- _2024-04-02, 15:22 UTC_: High number of 500s to the `/api/event` endpoint,
+ nothing actionable on our end.
## Related incident reports