Observability patterns Flashcards
Observability patterns
Log aggregation Application metrics Audit logging Distributed tracing Exception tracking Health check API Log deployments and changesnew
Log aggregation: contexts
You have applied the Microservice architecture pattern. The application consists of multiple services and service instances that are running on multiple machines. Requests often span multiple service instances.
Each service instance generates writes information about what it is doing to a log file in a standardized format. The log file contains errors, warnings, information and debug messages.
Log aggregation: problem
How to understand the behavior of an application and troubleshoot problems?
Log aggregation: forces
Any solution should have minimal runtime overhead
Log aggregation: solution
Use a centralized logging service that aggregates logs from each service instance. The users can search and analyze the logs. They can configure alerts that are triggered when certain messages appear in the logs.
Log aggregation: examples
AWS Cloud Watch
Log aggregation: result issue
handling a large volume of logs requires substantial infrastructure
Log aggregation: related
Distributed tracing - include the external request id in each log message
Exception tracking - as well as logging exceptions, report them to an exception tracking service
Application metrics: contexts
You have applied the Microservice architecture pattern.
Application metrics: problem
How to understand the behavior of an application and troubleshoot problems?
Application metrics: forces
Any solution should have minimal runtime overhead
Application metrics: solution
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
Application metrics: example
Instrumentation libraries: - Coda Hale/Yammer Java Metrics Library - Prometheus client libraries Metrics aggregation services: - Prometheus - AWS Cloud Watch
Application metrics: result benefits
It provides deep insight into application behavior
Application metrics: result drawbacks
Metrics code is intertwined with business logic making it more complicated
Application metrics: result issues
Aggregating metrics can require significant infrastructure
Audit logging: context
You have applied the Microservice architecture pattern.
Audit logging: problem
How to understand the behavior of users and the application and troubleshoot problems?
Audit logging: forces
It is useful to know what actions a user has recently performed: customer support, compliance, security, etc.