Lesson 3: Observability
Mapping metrics and logs to your architecture.
Lesson 3: Observability
You can’t fix what you can’t see. Observability is about understanding the internal state of your system from the outside.
The Three Pillars
- Logs: “What happened?” (Error: Payment Failed)
- Metrics: “How often?” (Error Rate: 5%)
- Traces: “Where?” (Checkout -> API -> DB)
Mapping to Sruja
Your Sruja components should map 1:1 to your observability dashboards.
- System
OrderService-> DashboardOrder Service Overview - Container
Database-> Metricpostgres_cpu_usage
Standardizing with Policies
You can enforce observability standards using Sruja Policies.
policy Observability "Must have metrics" {
rule "HealthCheck" {
check "all containers must have health check endpoint"
}
}
This ensures every new service you build comes with the necessary hooks for monitoring.