Skip to content

feat: migrate metrics to dedicated server#65

Merged
allisson merged 3 commits intomainfrom
healthcheck-refactor
Feb 25, 2026
Merged

feat: migrate metrics to dedicated server#65
allisson merged 3 commits intomainfrom
healthcheck-refactor

Conversation

@allisson
Copy link
Owner

  • Extract the Prometheus /metrics endpoint into a dedicated HTTP server (MetricsServer) to prevent exposing internal telemetry on the public API port.
  • Enhance the /ready endpoint to perform an active database connection check using db.PingContext. It now returns varying HTTP statuses (200 OK or 503 Service Unavailable) and a JSON payload detailing component health.
  • Update the main Server constructor to require a *sql.DB dependency for the readiness probe.
  • Update application startup and graceful shutdown logic to manage both the main API server and the secondary metrics server.
  • Adapt unit and integration tests to accommodate the updated /ready response format and the isolated metrics routing.

Extract the Prometheus /metrics endpoint into a dedicated HTTP server (MetricsServer) to prevent exposing internal telemetry on the public API port.
Enhance the /ready endpoint to perform an active database connection check using db.PingContext. It now returns varying HTTP statuses (200 OK or 503 Service Unavailable) and a JSON payload detailing component health.
Update the main Server constructor to require a *sql.DB dependency for the readiness probe.
Update application startup and graceful shutdown logic to manage both the main API server and the secondary metrics server.
Adapt unit and integration tests to accommodate the updated /ready response format and the isolated metrics routing.
@allisson allisson merged commit 3cc13c5 into main Feb 25, 2026
2 checks passed
@allisson allisson deleted the healthcheck-refactor branch February 25, 2026 13:27
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.

1 participant