Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add monitoring to the backend. Use Alloy + Loki to ingest logs, and use Grafana as a dashboard. Grafana Alerts + Discord Webhooks are then used for notifications.
Every five minutes, error logs are checked for in the
core-apiservice. These errors are then aggregated and sent via a Discord webhook (currently using default template, but can be modified if necessary).To use our existing auth flow with Grafana, we use our API as an auth proxy. Going to routes matching
/grafana/*checks that the user has the admin role, then proxies to Grafana.I made a new folder
monitoring/which stores the configuration files. Insidemonitoring/there is a.envfile with the secretDISCORD_WEBHOOK=which specifies the Discord Webhook URL. I can reorganize this if necessary.This PR is marked as draft since production deployment still needs to be configured, but this should work for local development (can test auth flow going to
http://localhost:8080/grafana).TODO:
Linked GitHub Issue
#317
Type of Change
Checklist
Additional Notes
To allow for more robust parsing of logs, I changed the output of
zerologto print structured JSON instead of using console writer.