Skip to content

Conversation

@naps62
Copy link
Member

@naps62 naps62 commented Feb 3, 2026

Currently setting up a grafana dashboard on our hosted instace for some visualization

This sets up the app side of it to:

  • output JSON logging (friendlier to grafana)
  • expose a /metrics endpoint to the alloy scraper, which includes system metrics as well as some business ones (stack creation, etc)
  • the metrics endpoint will be blocked from external access via traefik config

Copilot AI review requested due to automatic review settings February 3, 2026 10:43
@vercel
Copy link

vercel bot commented Feb 3, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
stacks Ready Ready Preview, Comment Feb 3, 2026 2:54pm

Request Review

Copy link
Contributor

Copilot AI left a 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 /metrics endpoint 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.

@naps62 naps62 merged commit 752ea68 into main Feb 3, 2026
3 checks passed
@naps62 naps62 deleted the prom branch February 3, 2026 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants