Skip to content

feat: add prometheus monitoring stack and grafana dashboard for k8s - #269

Open
escoutdoor wants to merge 14 commits into
mainfrom
feat/add-metrics
Open

feat: add prometheus monitoring stack and grafana dashboard for k8s#269
escoutdoor wants to merge 14 commits into
mainfrom
feat/add-metrics

Conversation

@escoutdoor

@escoutdoor escoutdoor commented Jun 21, 2026

Copy link
Copy Markdown
Collaborator

Closes #268

What

Adds centralized observability for the Kubernetes setup.

Changes

  • Metrics instrumentation: each service now exposes /metrics with HTTP request counters, response time histograms, and Go runtime stats (goroutines, heap, GC)
  • Prometheus discovery: added ServiceMonitor resources for all services so Prometheus auto-discovers endpoints
  • Grafana dashboard: single dashboard with RPS, error rate (5xx/4xx), latency percentiles (p50/p95/p99), and Go runtime stats. Includes a service selector dropdown
  • Auto-import: dashboard is loaded automatically via Kustomize ConfigMap with grafana_dashboard label
  • Docs: added docs/k8s/monitoring.md explaining how the stack works and how to add monitoring to new services
  • Kind support: added make kind-load for Kind users and updated local-kubernetes.md

Why

Before this change, debugging performance required checking individual pod logs. Now the team has a single URL with live metrics for all services.

How to verify

  1. make monitoring-up — deploys Prometheus + Grafana
  2. make monitoring-forward-grafana opens Grafana at localhost:3000
  3. make monitoring-forward-prometheus opens Prometheus at localhost:9090
  4. Dashboard shows live data for guest-api, business-api, and admin-auth
  5. docs/k8s/monitoring.md contains the setup instructions.

Summary by CodeRabbit

Release Notes

  • New Features
    • Added Prometheus metrics support with /metrics endpoints and request/latency tracking across services, plus business event counters.
    • Added a Grafana dashboard for service health, performance, and business activity.
    • Introduced local Prometheus support (compose) and documented PROMETHEUS_PORT default.
    • Expanded local Kubernetes setup to support kind, including image loading.
    • Added automated monitoring stack install/remove with configurable Helm chart version.
  • Bug Fixes
    • Updated Kubernetes readiness check during k8s-up to wait for the CNPG cluster to become ready.

@escoutdoor escoutdoor added enhancement New feature or request task Technical task to implement k8s labels Jun 21, 2026
@escoutdoor escoutdoor self-assigned this Jun 21, 2026
@coderabbitai

coderabbitai Bot commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: cefb2236-0f58-41d4-8a39-ecb83728eb16

📥 Commits

Reviewing files that changed from the base of the PR and between 688a177 and 4b7fb3a.

📒 Files selected for processing (24)
  • Makefile
  • deploy/k8s/guest/configmap.yaml
  • deploy/k8s/monitoring/share-bite-services.json
  • internal/admin-auth/handler/admin/handler.go
  • internal/admin-auth/handler/auth/handler.go
  • internal/admin-auth/handler/tests/handler_admin_test.go
  • internal/admin-auth/handler/tests/handler_oauth_test.go
  • internal/admin-auth/handler/tests/logout_revoke_test.go
  • internal/admin-auth/handler/tests/mocks_test.go
  • internal/admin-auth/handler/tests/user_status_test.go
  • internal/business/handler/business/create-org.go
  • internal/business/handler/business/create_box.go
  • internal/business/handler/business/create_location.go
  • internal/business/handler/business/create_post.go
  • internal/business/handler/business/list_boxes_test.go
  • internal/business/handler/business/reserve_box.go
  • internal/business/handler/business/resubmit_verification_test.go
  • internal/business/handler/business/search_venues_test.go
  • internal/guest/handler/collection/create_collection.go
  • internal/guest/handler/collection/invite_collaborator.go
  • internal/guest/handler/follow/follow.go
  • internal/guest/handler/post/create.go
  • internal/guest/handler/post/like.go
  • internal/guest/handler/post/mock_test.go
✅ Files skipped from review due to trivial changes (6)
  • deploy/k8s/guest/configmap.yaml
  • internal/business/handler/business/reserve_box.go
  • internal/business/handler/business/create_location.go
  • internal/admin-auth/handler/tests/mocks_test.go
  • internal/guest/handler/collection/invite_collaborator.go
  • internal/admin-auth/handler/tests/handler_admin_test.go
🚧 Files skipped from review as they are similar to previous changes (10)
  • internal/business/handler/business/create-org.go
  • internal/guest/handler/post/like.go
  • internal/guest/handler/collection/create_collection.go
  • internal/guest/handler/follow/follow.go
  • internal/business/handler/business/create_box.go
  • internal/guest/handler/post/create.go
  • internal/business/handler/business/create_post.go
  • internal/admin-auth/handler/admin/handler.go
  • internal/admin-auth/handler/auth/handler.go
  • Makefile

📝 Walkthrough

Walkthrough

Adds end-to-end Prometheus/Grafana observability across all three Go services. Each service gets a dedicated metrics package (HTTP counters/histograms, active-request gauge, domain-specific event counters), a shared Gin middleware, a /metrics endpoint, and handler-level metric calls. Docker Compose and Kubernetes receive Prometheus scrape configs, ServiceMonitor resources, Helm values for kube-prometheus-stack, a Grafana dashboard JSON, Makefile lifecycle targets, and supporting documentation.

Changes

Prometheus/Grafana Monitoring Stack

Layer / File(s) Summary
Per-service Prometheus metrics packages
internal/admin-auth/metrics/metrics.go, internal/business/metrics/metrics.go, internal/guest/metrics/metrics.go
Three parallel metrics packages each define a struct with HTTP CounterVec, HistogramVec, activeRequests gauge, and domain-specific counters. Each exports New, IncRequestCounter, HistogramResponseTimeObserve, IncActiveRequests, DecActiveRequests, and domain Record* methods.
Shared Gin metrics middleware
internal/middleware/metrics.go
Adds a Metrics(m metrics, ignoredPaths) gin.HandlerFunc that skips ignored routes, tracks active requests with a deferred decrement, times handling around c.Next(), and records counter and histogram observations.
Metrics wiring in API entrypoints
cmd/admin-auth-api/main.go, cmd/business-api/main.go, cmd/guest-api/main.go
Each entrypoint adds an appName constant, creates a dedicated prometheus.NewRegistry, constructs the service metrics instance, installs the metrics middleware before ErrorMiddleware, registers GET /metrics via promhttp.HandlerFor, and passes the metrics instance to handler constructors.
Handler-level domain metric calls and test updates
internal/admin-auth/handler/..., internal/business/handler/business/..., internal/guest/handler/..., internal/*/handler/tests/*
Wires the metrics dependency into each handler struct and calls Record* methods on success paths: auth login/registration/OAuth, business reviews, org/location/box/post creation, box reservation, post likes, collection creation/invitations, and follows. All test files updated to pass nil metrics argument in handler constructors.
Docker Compose Prometheus configuration
build/prometheus.yaml, build/prometheus.local.yaml, build/compose.infra.yaml, deploy/compose/compose.local.yaml, .env.example
Adds Prometheus scrape configs targeting service hostnames (and host.docker.internal for non-Docker runs). Adds a prometheus service with port mapping, config bind-mount, and prometheus_data volume to both Compose files. Adds PROMETHEUS_PORT=9090 to .env.example.
Kubernetes Service labels, ServiceMonitor resources, and deployment adjustments
deploy/k8s/guest/..., deploy/k8s/admin-auth/..., deploy/k8s/business/..., deploy/k8s/infra/...
Adds metadata.labels.app to all three Service manifests. Creates one ServiceMonitor per service scraping /metrics every 15s with release: kube-prometheus-stack label. Updates kustomizations to include monitors. Adds DB env vars from CNPG secret to admin-auth deployment. Changes APP_NAME to share_bite in infra configmap. Comments out secret.yaml from infra kustomization.
Kubernetes monitoring namespace: Helm values, Grafana dashboard, Kustomize wiring
deploy/k8s/monitoring/..., deploy/k8s/kustomization.yaml
Adds metrics-values.yaml (Alertmanager off, Grafana with existing Secret, empty ServiceMonitor selectors for cross-namespace discovery, 10d retention), grafana-secret.yaml, and a Kustomize manifest generating the dashboard ConfigMap from the full Grafana dashboard JSON (Overview stats, HTTP Traffic, Latency percentiles, Errors, Business Activity/Trends, Service Health, Go Runtime extended, Process).
Makefile kind and monitoring lifecycle targets
Makefile
Adds CHART_VERSION variable, kind-load, monitoring-up, monitoring-down, monitoring-forward-grafana, monitoring-forward-prometheus targets, and changes k8s-up readiness check from statefulset/postgres rollout to kubectl wait on cluster/share-bite-cnpg Ready condition.
Developer documentation
docs/k8s/local-kubernetes.md, docs/k8s/monitoring.md
Adds kind setup instructions to local-kubernetes guide. Adds monitoring.md documenting chart components, installation, local access via port-forward helpers, dashboard auto-loading via Kustomize, and the checklist for adding a new service (metrics endpoint, ServiceMonitor with release: kube-prometheus-stack, Service metadata.labels.app).

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • ua-academy-projects/share-bite#88: Modifies business HTTP handler wiring in internal/business/handler/business/handler.go where RegisterHandlers signature is extended to inject dependencies.
  • ua-academy-projects/share-bite#105: Adds collections CRUD implementations in internal/guest/handler/collection/ alongside the main PR's metrics dependency threading through the same handlers.
  • ua-academy-projects/share-bite#109: Introduces the CreateBox endpoint in internal/business/handler/business/create_box.go, directly overlapping with this PR's conditional RecordBoxCreated() metric call in the same handler.

Suggested labels

documentation

Suggested reviewers

  • mblinovv
  • viktorzhabskyi
  • DmyMi

🐇 A rabbit hops through each service lane,
Counting requests in sunshine and rain.
Histograms measure how long things take,
Grafana panels light up in their wake!
Now latency, errors, and goroutines gleam —
Observability powers the whole team's dream. 📊✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 9.68% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding Prometheus monitoring and Grafana dashboard support for Kubernetes deployments.
Linked Issues check ✅ Passed All four acceptance criteria from issue #268 are met: services expose /metrics with HTTP and Go runtime metrics [admin-auth, business, guest], Prometheus auto-discovery via ServiceMonitor resources, comprehensive Grafana dashboard with service dropdown, and docs/k8s/monitoring.md documentation.
Out of Scope Changes check ✅ Passed All changes directly support monitoring implementation: metrics instrumentation in services, Prometheus/Grafana configuration, Kubernetes manifests, Makefile targets, and documentation. No unrelated modifications present.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/add-metrics

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 7

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@build/prometheus.yaml`:
- Around line 18-32: The prometheus.yaml file has hardcoded targets using
host.docker.internal with ports 3800, 3850, and 3900, but when this
configuration is used with deploy/compose/compose.local.yaml, the actual service
ports are different (8082, 8080, 8081), causing Prometheus to fail scraping.
Create a new file prometheus.compose.local.yaml specifically for the compose
deployment topology where the targets use service names (guest-api, admin-api,
business-api) on their internal ports (3800, 3850, 3900) instead of hardcoded
host addresses, and update the compose.local.yaml file to mount this new
configuration instead of the original prometheus.yaml.

In `@cmd/admin-auth-api/main.go`:
- Around line 82-90: The metrics middleware is currently being registered after
ErrorMiddleware, which causes it to record HTTP status codes before the error
handler has a chance to set the correct status. Move the metrics middleware
setup (the call to router.Use(metricsMiddleware)) to occur before the
ErrorMiddleware is registered so that error responses are properly recorded with
their correct status codes instead of 200. This reordering needs to be applied
in three files: cmd/admin-auth-api/main.go, cmd/business-api/main.go, and
cmd/guest-api/main.go.

In `@cmd/business-api/main.go`:
- Around line 80-93: The middleware registration order is incorrect:
ErrorMiddleware is registered before metricsMiddleware, but since Gin executes
response handlers in reverse registration order, metricsMiddleware records the
status code before ErrorMiddleware can set error codes like 404 or 400. Swap the
registration order so that metricsMiddleware is registered first (before
ErrorMiddleware), which will cause ErrorMiddleware to execute first during
response handling and set the correct error status code, allowing
metricsMiddleware to then record the accurate status in the metrics.

In `@cmd/guest-api/main.go`:
- Around line 91-103: The metrics middleware needs to be registered before the
error middleware to ensure it captures the correct HTTP status codes. Move the
router.Use(metricsMiddleware) call and the metrics setup (the
prometheus.NewRegistry(), metrics.New(), and middleware.Metrics() calls) to
occur before the router.Use(guest_middleware.ErrorMiddleware()) call. This
ensures the metrics middleware reads the final status codes after the error
middleware has translated errors to appropriate HTTP status codes.

In `@deploy/k8s/monitoring/share-bite-services.json`:
- Line 68: The share-bite-services.json dashboard file has multiple panels all
assigned the same ID value of 1, which prevents proper panel identification and
breaks editing functionality. Replace each panel's "id" field with a unique
sequential integer value, starting from 1 and incrementing for each subsequent
panel throughout the entire dashboard definition to ensure stable panel identity
and correct behavior during import/provisioning.

In `@deploy/k8s/monitoring/values.yaml`:
- Line 7: The `adminPassword: admin` field in the Grafana configuration is a
hardcoded weak credential stored in version control, which is a security risk.
Remove the plaintext `adminPassword: admin` entry from the values.yaml file and
instead configure the Grafana admin password through a Kubernetes Secret or via
CI/CD pipeline-provided values that are injected at deployment time. This
ensures sensitive credentials are not stored in git and can be properly managed
through your secrets management system.

In `@docs/k8s/monitoring.md`:
- Line 51: The documentation file contains an incorrect file path reference to
the dashboard JSON file on line 51. Replace the current path reference from
`docs/k8s/monitoring/share-bite-services.json` with the correct path
`deploy/k8s/monitoring/share-bite-services.json` so that developers looking at
the documentation can accurately locate the actual dashboard source file.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: bc7b312d-6afd-41cf-b720-9b70518cc7a2

📥 Commits

Reviewing files that changed from the base of the PR and between e5b4328 and d35032f.

📒 Files selected for processing (31)
  • .env.example
  • .gitignore
  • Makefile
  • build/compose.infra.yaml
  • build/prometheus.yaml
  • cmd/admin-auth-api/main.go
  • cmd/business-api/main.go
  • cmd/guest-api/main.go
  • deploy/compose/compose.local.yaml
  • deploy/k8s/admin-auth/admin-auth-service.yaml
  • deploy/k8s/admin-auth/admin-auth-servicemonitor.yaml
  • deploy/k8s/admin-auth/kustomization.yaml
  • deploy/k8s/business/business-service.yaml
  • deploy/k8s/business/business-servicemonitor.yaml
  • deploy/k8s/business/kustomization.yaml
  • deploy/k8s/guest/deployment.yaml
  • deploy/k8s/guest/kustomization.yaml
  • deploy/k8s/guest/service.yaml
  • deploy/k8s/guest/servicemonitor.yaml
  • deploy/k8s/infra/configmap.yaml
  • deploy/k8s/infra/kustomization.yaml
  • deploy/k8s/kustomization.yaml
  • deploy/k8s/monitoring/kustomization.yaml
  • deploy/k8s/monitoring/share-bite-services.json
  • deploy/k8s/monitoring/values.yaml
  • docs/k8s/local-kubernetes.md
  • docs/k8s/monitoring.md
  • internal/admin-auth/metrics/metrics.go
  • internal/business/metrics/metrics.go
  • internal/guest/metrics/metrics.go
  • internal/middleware/metrics.go

Comment thread build/prometheus.yaml Outdated
Comment thread cmd/admin-auth-api/main.go Outdated
Comment thread cmd/business-api/main.go Outdated
Comment thread cmd/guest-api/main.go Outdated
Comment thread deploy/k8s/monitoring/share-bite-services.json Outdated
Comment thread deploy/k8s/monitoring/metrics-values.yaml Outdated
Comment thread docs/k8s/monitoring.md Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@build/prometheus.local.yaml`:
- Line 21: The prometheus.local.yaml configuration uses host.docker.internal as
the target hostname on lines 21, 28, and 35, but this assumes Docker DNS
resolution which is not portable across all systems (particularly breaking on
Linux Docker). To fix this, add extra_hosts configuration to the Prometheus
service in the docker-compose file that uses this prometheus.local.yaml config
by specifying extra_hosts: ["host.docker.internal:host-gateway"] to enable
proper hostname resolution across different Docker environments. Alternatively,
document this as a runtime requirement that must be enforced when running the
services.

In `@Makefile`:
- Around line 220-221: The `kind-load` target hardcodes `:latest` as the image
tag for all four images (guest-api, business-api, admin-auth-api, and migrator),
which causes it to load images with the wrong tag when a custom TAG variable is
provided. Replace each `:latest` suffix with `$(TAG)` in the `kind load
docker-image` command so that the tag used matches the TAG variable that was
passed to the build process.
- Around line 238-240: The monitoring-down target's helm uninstall command for
kube-prometheus-stack will fail if the release is already absent. Add the
--ignore-not-found flag to the helm uninstall kube-prometheus-stack command to
make it idempotent and prevent failures when the release doesn't exist, similar
to the approach already used with kubectl delete namespace monitoring.
- Around line 223-236: The monitoring-up target applies the grafana-secret.yaml
before the monitoring namespace is created, causing the secret application to
fail. Either add a kubectl create namespace monitoring command before the
kubectl apply line that references deploy/k8s/monitoring/grafana-secret.yaml, or
modify the kubectl apply command to include the --create-namespace flag. Ensure
the namespace exists before attempting to apply the secret that declares
namespace: monitoring.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1a815556-ea7e-4128-8e9f-304dbab83099

📥 Commits

Reviewing files that changed from the base of the PR and between d35032f and c2094b1.

📒 Files selected for processing (32)
  • .env.example
  • Makefile
  • build/compose.infra.yaml
  • build/prometheus.local.yaml
  • build/prometheus.yaml
  • cmd/admin-auth-api/main.go
  • cmd/business-api/main.go
  • cmd/guest-api/main.go
  • deploy/compose/compose.local.yaml
  • deploy/k8s/admin-auth/admin-auth-service.yaml
  • deploy/k8s/admin-auth/admin-auth-servicemonitor.yaml
  • deploy/k8s/admin-auth/kustomization.yaml
  • deploy/k8s/business/business-service.yaml
  • deploy/k8s/business/business-servicemonitor.yaml
  • deploy/k8s/business/kustomization.yaml
  • deploy/k8s/guest/deployment.yaml
  • deploy/k8s/guest/kustomization.yaml
  • deploy/k8s/guest/service.yaml
  • deploy/k8s/guest/servicemonitor.yaml
  • deploy/k8s/infra/configmap.yaml
  • deploy/k8s/infra/kustomization.yaml
  • deploy/k8s/kustomization.yaml
  • deploy/k8s/monitoring/grafana-secret.yaml
  • deploy/k8s/monitoring/kustomization.yaml
  • deploy/k8s/monitoring/metrics-values.yaml
  • deploy/k8s/monitoring/share-bite-services.json
  • docs/k8s/local-kubernetes.md
  • docs/k8s/monitoring.md
  • internal/admin-auth/metrics/metrics.go
  • internal/business/metrics/metrics.go
  • internal/guest/metrics/metrics.go
  • internal/middleware/metrics.go
✅ Files skipped from review due to trivial changes (15)
  • deploy/k8s/business/business-service.yaml
  • deploy/k8s/monitoring/kustomization.yaml
  • deploy/k8s/infra/kustomization.yaml
  • build/prometheus.yaml
  • deploy/k8s/admin-auth/admin-auth-servicemonitor.yaml
  • deploy/k8s/admin-auth/admin-auth-service.yaml
  • deploy/k8s/monitoring/metrics-values.yaml
  • deploy/k8s/business/business-servicemonitor.yaml
  • deploy/k8s/monitoring/grafana-secret.yaml
  • deploy/k8s/infra/configmap.yaml
  • .env.example
  • docs/k8s/monitoring.md
  • deploy/k8s/guest/service.yaml
  • deploy/k8s/guest/deployment.yaml
  • deploy/k8s/admin-auth/kustomization.yaml
🚧 Files skipped from review as they are similar to previous changes (15)
  • internal/middleware/metrics.go
  • deploy/k8s/guest/servicemonitor.yaml
  • deploy/k8s/kustomization.yaml
  • deploy/k8s/business/kustomization.yaml
  • docs/k8s/local-kubernetes.md
  • deploy/compose/compose.local.yaml
  • internal/admin-auth/metrics/metrics.go
  • deploy/k8s/guest/kustomization.yaml
  • internal/guest/metrics/metrics.go
  • build/compose.infra.yaml
  • cmd/guest-api/main.go
  • internal/business/metrics/metrics.go
  • cmd/business-api/main.go
  • cmd/admin-auth-api/main.go
  • deploy/k8s/monitoring/share-bite-services.json

Comment thread build/prometheus.local.yaml
Comment thread Makefile Outdated
Comment thread Makefile
Comment thread Makefile
@escoutdoor
escoutdoor marked this pull request as ready for review June 22, 2026 11:35
@escoutdoor
escoutdoor requested review from DmyMi, IlyaMaluk, MihuNt3r and isaistvo and removed request for DmyMi, mblinovv and viktorzhabskyi June 22, 2026 11:36

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@deploy/k8s/monitoring/share-bite-services.json`:
- Around line 1549-1734: Several dashboard panels in share_bite_services.json
have overlapping or out-of-bounds gridPos values, which breaks Grafana’s
24-column layout. Update the affected panel definitions so each row uses
non-overlapping widths that stay within the grid, following a consistent pattern
like 0/8, 8/8, 16/8 for the grouped panels. Check the panel objects around the
timeseries and piechart sections, and adjust their x, w, and y values so the
affected rows at y=56, y=64, and y=72 align cleanly without collisions.

In `@Makefile`:
- Around line 227-230: The monitoring-up bootstrap steps are not safely
rerunnable because the helm repo setup can fail on an existing
prometheus-community entry and the kubectl namespace creation currently hides
real errors. Update the Makefile target around the helm repo add/update and
kubectl create namespace command so repeated runs succeed without error, and
remove the unconditional ignore behavior so bootstrap failures in these steps
surface immediately. Use the monitoring-up target and the prometheus-community
helm repo / kubectl namespace creation commands to locate the fix.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 357c89f3-3e5a-4ad6-b6e9-9a5ca3b386c6

📥 Commits

Reviewing files that changed from the base of the PR and between c2094b1 and 688a177.

📒 Files selected for processing (49)
  • .env.example
  • Makefile
  • build/compose.infra.yaml
  • build/prometheus.local.yaml
  • build/prometheus.yaml
  • cmd/admin-auth-api/main.go
  • cmd/business-api/main.go
  • cmd/guest-api/main.go
  • deploy/compose/compose.local.yaml
  • deploy/k8s/admin-auth/admin-auth-deployment.yaml
  • deploy/k8s/admin-auth/admin-auth-service.yaml
  • deploy/k8s/admin-auth/admin-auth-servicemonitor.yaml
  • deploy/k8s/admin-auth/kustomization.yaml
  • deploy/k8s/business/business-service.yaml
  • deploy/k8s/business/business-servicemonitor.yaml
  • deploy/k8s/business/kustomization.yaml
  • deploy/k8s/guest/deployment.yaml
  • deploy/k8s/guest/kustomization.yaml
  • deploy/k8s/guest/service.yaml
  • deploy/k8s/guest/servicemonitor.yaml
  • deploy/k8s/infra/configmap.yaml
  • deploy/k8s/infra/kustomization.yaml
  • deploy/k8s/kustomization.yaml
  • deploy/k8s/monitoring/grafana-secret.yaml
  • deploy/k8s/monitoring/kustomization.yaml
  • deploy/k8s/monitoring/metrics-values.yaml
  • deploy/k8s/monitoring/share-bite-services.json
  • docs/k8s/local-kubernetes.md
  • docs/k8s/monitoring.md
  • internal/admin-auth/handler/admin/handler.go
  • internal/admin-auth/handler/auth/handler.go
  • internal/admin-auth/metrics/metrics.go
  • internal/business/handler/business/create-org.go
  • internal/business/handler/business/create_box.go
  • internal/business/handler/business/create_location.go
  • internal/business/handler/business/create_post.go
  • internal/business/handler/business/handler.go
  • internal/business/handler/business/reserve_box.go
  • internal/business/metrics/metrics.go
  • internal/guest/handler/collection/create_collection.go
  • internal/guest/handler/collection/handler.go
  • internal/guest/handler/collection/invite_collaborator.go
  • internal/guest/handler/follow/follow.go
  • internal/guest/handler/follow/handler.go
  • internal/guest/handler/post/create.go
  • internal/guest/handler/post/handler.go
  • internal/guest/handler/post/like.go
  • internal/guest/metrics/metrics.go
  • internal/middleware/metrics.go
✅ Files skipped from review due to trivial changes (17)
  • deploy/k8s/business/kustomization.yaml
  • deploy/k8s/monitoring/kustomization.yaml
  • internal/business/handler/business/create_location.go
  • deploy/k8s/kustomization.yaml
  • deploy/k8s/monitoring/grafana-secret.yaml
  • internal/guest/handler/collection/invite_collaborator.go
  • deploy/k8s/guest/service.yaml
  • deploy/k8s/business/business-service.yaml
  • internal/guest/handler/follow/follow.go
  • internal/guest/handler/post/like.go
  • deploy/k8s/admin-auth/admin-auth-service.yaml
  • deploy/k8s/monitoring/metrics-values.yaml
  • docs/k8s/local-kubernetes.md
  • deploy/k8s/guest/kustomization.yaml
  • deploy/k8s/admin-auth/kustomization.yaml
  • docs/k8s/monitoring.md
  • .env.example
🚧 Files skipped from review as they are similar to previous changes (9)
  • deploy/k8s/guest/servicemonitor.yaml
  • deploy/k8s/admin-auth/admin-auth-servicemonitor.yaml
  • deploy/k8s/infra/kustomization.yaml
  • build/prometheus.local.yaml
  • build/prometheus.yaml
  • deploy/k8s/guest/deployment.yaml
  • deploy/k8s/business/business-servicemonitor.yaml
  • build/compose.infra.yaml
  • deploy/compose/compose.local.yaml

Comment thread deploy/k8s/monitoring/share-bite-services.json
Comment thread Makefile Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request k8s task Technical task to implement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add centralized monitoring stack and team documentation for service metrics

1 participant