In this blog, I would like to share with you some of the information I gained while attending the AWS Community Day 2022.
Session Name Observability Masterclass Presented By: Chris Cooney, Developer Advocate@Corologix
- The fundamentals
- What is observability?
- Why is observability such an important conversation in 2022
- Best practices
- How to get the most out of your logs, metrics and traces
- Techniques for scaling your platform
- The big question that you will face
- Build or buy? the eternal Debate.
- How are we going to pay for all the data?
What is observability?
Monitoring: it allows you to take a simple, static view of your data for example car dashboard which shows speed, and fuel.
But observability allows you to Discover new things about your system.
For eg: using distance and fuel consumed we can figure out the mileage
3 pillars of observability:
- Metrics that can be queried and rendered in different ways. Metrics are measured values derived from system performance. Examples:
- Application metrics
- Infrastructure Metrics
- Custom Metrics -SLOs, Sales rate, profit etc.
- Logs: that can capture transformed and visualized in a new format to yield novel insights Example:
- Infrastructure Logs
- Application logs
- API Logs
- Audit and Security logs
- Traces that can tell you the journey of even a single request through your system. The trace consists of:
- A collection of “Spans”
- Any errors that occurred
- The duration of the trace and the duration of each span
- Custom Values can be added.
Difference between old monolithic architecture and microservices monitoring
monolithic architecture: less number of Resources to monitor easy to monitor but less scalable
- microservices architecture: more number of services to monitor but more scalable
General Best Practices:
1. Focus on open-source integrations, even if you use a SaaS solution. to be safe from lock-in
2. Think about the scale of your infrastructure upfront. How much data does each application output? How much do you need to store? This is going to become very important.
Logging Best Practice
- Decorate your logs with useful metadata
- Log in the machine-readable format “JSON”
- Hot worm and cold storage to manage cost
- USE MDC(Mapped diagnostic context: it will make sure we don’t pollute our log generation
Metric Best practice:
1. Create granular metrics. You can always aggregate them later.
Traces Best practices:
1. Identify a discrete, high-value transaction.
- Identify the point of ingress and egress in your system.
- Try to instrument everything. An incomplete trace can mislead you about the problem.
Deciding whether to buy or build an observability solution.
What to store, where to store it, and how to log it to prevent data explosion.
This session will give you some really good practices to keep in mind before thinking about observability.