# Application Metrics

> Instrument your services to emit stats — then aggregate, alert, and actually know what's happening.

- **Category**: Microservices
- **Subcategory**: Observability
- **Canonical URL**: https://designpattern.fyi/patterns/application_metrics/

---

## Description
Clean, reusable architecture pattern.


## Use Cases
Order Service emits p99 latency per endpoint. Prometheus scrapes every 15s. Grafana alerts when p99 > 500ms. On-call gets paged before users notice.





## Trade-offs


### Advantages

- Real-time operational visibility — no more guessing

- Proactive alerting catches issues before users complain

- Enables capacity planning and scaling decisions

- Great audit trail for post-mortems




### Considerations & Drawbacks

- Cardinality explosion can tank Prometheus if you label carelessly

- Every service needs instrumentation — ongoing dev effort

- Metrics infra (Prometheus, Grafana) needs to be maintained

- Easy to collect everything, hard to collect the right things







---
**Reference**: [Original Source](https://microservices.io/patterns/observability/application-metrics.html)

