Skip to content

refactor(observability): move metrics wiring and document health endpoints - #7

Merged
Jonathan0823 merged 2 commits into
masterfrom
feat/observability-swagger-boundary
Jul 31, 2026
Merged

Jonathan0823 merged 2 commits into
masterfrom
feat/observability-swagger-boundary

Conversation

@Jonathan0823

Copy link
Copy Markdown
Owner

Summary

  • Move Gin-specific metrics middleware and /metrics route registration into the inbound HTTP adapter.
  • Keep Prometheus collectors, registry, and framework-neutral metric methods in internal/platform.
  • Add Swagger documentation for /health/live and /health/ready.
  • Regenerate the committed Swagger artifacts and add coverage for operational route documentation.
  • Keep /metrics operational-only and intentionally excluded from Swagger.

Scope

In scope:

  • HTTP/platform layering cleanup for metrics
  • Health endpoint Swagger documentation
  • Generated Swagger artifacts and validation tests
  • README clarification for operational endpoints

Out of scope:

  • Prometheus metric redesign
  • Grafana, Loki, or OpenTelemetry
  • Persistent audit storage
  • Database migrations

Testing

  • go test ./...
  • go vet ./...
  • gofmt verification
  • make swagger
  • make swagger-validate
  • make integration
  • git diff --check

make swagger-validate succeeds with the existing Redocly advisory warnings that the health operations do not define 4xx responses; these endpoints intentionally return only health status responses.

Reviewer focus

  • Confirm internal/platform/metrics.go no longer depends on Gin.
  • Review route-template labels and metrics middleware behavior after the move.
  • Confirm health responses and generated Swagger paths match the handlers.
  • Confirm /metrics remains opt-in and absent from Swagger.

Migrations and risks

  • No database migrations required.
  • No authentication behavior changes.
  • The metrics route remains disabled unless ENABLE_METRICS=true.

@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@Jonathan0823, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 46 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: c50e51b0-b38c-423b-9f56-950fca7dbec2

📥 Commits

Reviewing files that changed from the base of the PR and between af8b66f and 37a420f.

📒 Files selected for processing (13)
  • README.md
  • docs/docs.go
  • docs/swagger.json
  • docs/swagger.yaml
  • internal/adapter/inbound/http/health.go
  • internal/adapter/inbound/http/metrics.go
  • internal/adapter/inbound/http/metrics_test.go
  • internal/adapter/inbound/http/middleware/metrics.go
  • internal/adapter/inbound/http/swagger_test.go
  • internal/adapter/inbound/http/swagger_types.go
  • internal/bootstrap/bootstrap.go
  • internal/platform/metrics.go
  • internal/platform/metrics_test.go

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Jonathan0823
Jonathan0823 merged commit 9bf9232 into master Jul 31, 2026
10 checks passed
@Jonathan0823
Jonathan0823 deleted the feat/observability-swagger-boundary branch July 31, 2026 03:15
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