/metrics endpoints and stores time series data. It can centralize metrics from multiple data centers and cloud providers, federate between Prometheus servers, and forward metrics to long‑term storage using remote_write or a remote storage adapter. Prometheus also provides a built‑in expression browser and graphing UI, but many teams pair Prometheus with Grafana for richer dashboards.
Prometheus scrapes instrumented endpoints. For multi‑datacenter deployments consider federation,
remote_write, or a remote storage adapter. Use exporters (for example, node_exporter or mysqld_exporter) to expose system and application metrics for Prometheus to scrape.
Use case #2: alerting on memory exhaustion
Scenario: repeated outages caused by high memory usage on the MySQL host. The operations team needs email alerts when memory usage reaches 80% so they can act before users are affected. Prometheus evaluates alerting rules and sends alerts to Alertmanager. Alertmanager handles grouping, silencing, and routing alerts to notification channels such as email, Slack, PagerDuty, or SMS. You declare alerting rules in Prometheus and configure Alertmanager to deliver notifications.
node_exporter metrics) looks like this:
Important: Prometheus evaluates and emits alerts defined in its alerting rules. Delivery (email, Slack, PagerDuty, SMS, etc.) is performed by Alertmanager, so be sure to configure Alertmanager routes, receivers, and inhibition rules for reliable notification.
Use case #3: correlating upload size and latency
Goal: determine at which uploaded file size application latency starts to degrade. Approach:- Instrument the application to expose counters for request duration and upload size (typically
_sumand_countfor each histogram or summary). - Use PromQL to compute average values (sum/count) with
rate()over a chosen window. - Plot average upload size and average request latency on the same dashboard to identify the inflection point.
- Optionally create recording rules for these computed metrics to make dashboards and alerts more efficient.
and/unless or comparison expressions in PromQL).
Summary and recommended patterns
- Prometheus scrapes metrics from instrumented applications and exporters across data centers and cloud environments.
- Use Prometheus alerting rules together with Alertmanager for notification management (grouping, silencing, routing).
- Use PromQL and recording rules to compute derived metrics (averages, rates) and to correlate signals such as upload size vs. latency.
- For multi‑site and long‑term storage scenarios consider federation,
remote_write, or a remote storage adapter. - Pair Prometheus with Grafana for advanced dashboards and visual correlation.
Links and references
- Prometheus federation documentation
- Prometheus remote_write configuration
- Prometheus exporters
- Prometheus alerting rules
- Alertmanager documentation
- PromQL basics
- Recording rules
- Grafana — dashboards and visualization for Prometheus metrics