Handle Plausible outages #2996
Labels
💻 aspect: code
Concerns the software code in the repository
🧰 goal: internal improvement
Improvement that benefits maintainers, not users
🟨 priority: medium
Not blocking but should be addressed soon
🧱 stack: frontend
Related to the Nuxt frontend
Problem
When Plausible server was out on August 28th, we received reports of many 5xx responses from Nuxt. This was misleading because there was no degradation of Openverse frontend for the user (the analytics requests are not blocking and don't break anything in the UI if they fail).
Description
We should re-write the response header in case Plausible returns 503. Here's is the example of rewriting for 504 errors:
openverse/frontend/nuxt.config.ts
Lines 337 to 344 in 6408b42
In case the error message contains "service unavailable", we should add the error message to the message that is logged to the console. I think we don't event need to check if it's prod or dev environment, as we might want to see the message logged everywhere.
Note: I am not sure about the shape of the
err
object here. In Cloudflare, I can only see the "Edge status code" and "Origin status code", both equal to "503 Service Unavailable"The text was updated successfully, but these errors were encountered: