Skip to content

add Prometheus monitoring for Compose and Azure deploy - #73

Merged
timn21 merged 1 commit into
mainfrom
feature/prometheus-monitoring
Jul 2, 2026
Merged

timn21 merged 1 commit into
mainfrom
feature/prometheus-monitoring

Conversation

@JonathanPschl

@JonathanPschl JonathanPschl commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

Closes #68

Summary

Adds a minimal Prometheus monitoring setup, wired up for both the local Docker
Compose stack and the Azure VM deployment. Each service exposes an HTTP metrics
endpoint, and a single Prometheus container scrapes them all.

Changes

Application

  • Spring services (api-gateway, user-service, grocery-service): added
    spring-boot-starter-actuator + micrometer-registry-prometheus, exposed the
    health and prometheus actuator endpoints, tagged metrics with the service
    name. Served at /actuator/prometheus.
  • gen-ai (FastAPI): added prometheus-fastapi-instrumentator, exposing /metrics.

Local (Docker Compose)

  • New prom/prometheus:v2.54.1 service in compose.yaml on port 9090, with
    monitoring/prometheus.yml mounted and a prometheus-data volume.
  • monitoring/prometheus.yml: scrape config for all four services.

Azure deployment

  • Ansible (infra/ansible/roles/deploy/tasks/main.yml): copy
    monitoring/prometheus.yml to the VM.
  • Terraform (infra/terraform/main.tf): open NSG port 9090 for
    dev-stage.

Docs

  • README "Monitoring (Prometheus)" section.

How to test

Local:

  1. docker compose up --build
  2. Open http://localhost:9090/targets — all 5 jobs should be UP.
  3. Generate a recipe in the app (http://localhost:8081).
  4. Query http_server_requests_seconds_count (Spring) and http_requests_total
    (gen-ai) — counts across gateway → backends → gen-ai reconcile with the action.

Azure: after deploy, Prometheus UI is at http://<vm-public-ip>:9090.

@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

An error occurred during the review process. Please try again later.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/prometheus-monitoring

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.

@timn21 timn21 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good

@timn21
timn21 merged commit 602d82f into main Jul 2, 2026
11 of 12 checks passed
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.

Add Prometheus

2 participants