-
Notifications
You must be signed in to change notification settings - Fork 0
Prometheus + JSON logging for grafana #82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds Prometheus metrics and JSON logging support to enable Grafana dashboard visualization. The implementation includes structured logging with request context, a metrics endpoint for Prometheus scraping, and telemetry instrumentation for business events.
Changes:
- Added Prometheus metrics exporter with system metrics (VM memory, queue lengths) and business metrics (stack lifecycle, authentication events)
- Implemented JSON logging with LoggerJSON formatter and request metadata enrichment via LogMetadata plug
- Exposed
/metricsendpoint for internal Prometheus scraping (secured via Docker network isolation)
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 15 comments.
Show a summary per file
| File | Description |
|---|---|
| server/mix.exs | Added dependencies for telemetry_metrics_prometheus_core and logger_json |
| server/mix.lock | Updated lock file with new dependencies |
| server/lib/ethui_web/telemetry.ex | Configured Prometheus metrics reporter, converted metrics from summary to distribution with histograms, added business metrics definitions |
| server/lib/ethui_web/router.ex | Added /metrics endpoint in bare scope for Prometheus scraping |
| server/lib/ethui_web/endpoint.ex | Integrated LogMetadata plug into request pipeline |
| server/lib/ethui_web/plugs/log_metadata.ex | New plug to enrich logs with request context (request_id, user_id, stack_slug, etc.) |
| server/lib/ethui_web/controllers/metrics_controller.ex | New controller to expose Prometheus metrics via HTTP endpoint |
| server/lib/ethui_web/controllers/api/stack_controller.ex | Added telemetry events for stack creation and deletion |
| server/lib/ethui_web/controllers/api/auth_controller.ex | Added telemetry events for authentication code sending and verification |
| server/config/runtime.exs | Configured JSON logging for production environment |
| compose.saas.yml | Added Prometheus scraping labels for Docker service discovery |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Currently setting up a grafana dashboard on our hosted instace for some visualization
This sets up the app side of it to:
/metricsendpoint to the alloy scraper, which includes system metrics as well as some business ones (stack creation, etc)