Pattern: Application metrics
You have applied the Microservice architecture pattern.
How to understand the behavior of an application and troubleshoot problems?
- Any solution should have minimal runtime overhead
Instrument a service to gather statistics about individual operations. Aggregate metrics in centralized metrics service, which provides reporting and alerting. There are two models for aggregating metrics:
- push - the service pushes metrics to the metrics service
- pull - the metrics services pulls metrics from the service
- Instrumentation libraries:
- Metrics aggregation services
This pattern has the following benefits:
- It provides deep insight into application behavior
This pattern has the following drawbacks:
- Metrics code is intertwined with business logic making it more complicated
This pattern has the following issues:
- Aggregating metrics can require significant infrastructure