d. Prometheus
Prometheus works by pulling (scraping) metrics from each service endpoint at a configured interval and storing the time-series data locally.
Create the file setup/prometheus/prometheus.yml:
Key points:
| Field | Description |
|---|---|
job_name | Logical name for the scrape job; appears as a label in all collected metrics. |
metrics_path | Must match the base-path defined in each service's application.yaml. |
targets | Uses Docker service hostnames (gateway, auth, account) and the internal port 8080. |
scrape_interval | How often Prometheus pulls fresh metrics from each target. |
Once the stack is running, access the Prometheus UI to query metrics directly: