


- Metrics: tell you WHAT is happening (time-series numeric signals).
- Logs: explain WHY it’s happening (diagnostic messages, state changes).
- Traces: show WHERE it happens (end-to-end request flow across services).

- Definition: numerical time-series collected at fixed intervals (counts, sums, gauges, histograms).
- Decide sampling frequency and dimensionality based on business needs — high-frequency trading needs finer granularity than a typical SaaS app.
- Keep metrics lightweight and aggregated where possible to reduce cost and cardinality issues.
- Typical metric categories:
- Infrastructure: CPU, memory, disk I/O, network throughput
- Application: request count, error rate, response time (p95/p99)
- Business: orders per minute, conversion rate, revenue


Logs — structured logging, retention, and querying
- Unstructured logs are free text and harder to analyze; structured logs (JSON) are easier to query, index, and correlate.
- Include correlation IDs in logs to connect traces and log entries across services.
- Use sensible retention and sampling strategies; you can tier data (hot/warm/cold) to balance cost and compliance.
- In CloudWatch, organize logs into Log Groups (per application/service) and Log Streams (sequence of log events). Use CloudWatch Logs Insights for fast, ad-hoc queries.
- Consider streaming logs to S3 for long-term archival and analytical processing.
Prefer structured logging (JSON) from day one. It saves time and cost later when you need to query, correlate, or archive logs.

- Tracing captures the full lifecycle of a request across services and resources (API Gateway → service → DB → downstream).
- Distributed tracing reveals which component adds latency or fails and visualizes dependencies with timing breakdowns.
- AWS X‑Ray provides service maps, traces, annotations, and metadata. You can add custom annotations and metadata for richer context.
- OpenTelemetry is the industry standard for telemetry; use the AWS Distro for OpenTelemetry (ADOT) to export telemetry to CloudWatch, X‑Ray, or third-party systems.
- For AWS exam and operating in AWS, prioritize understanding X‑Ray and ADOT integration.



- Metric alarm fires (e.g., connection timeouts > 5% for 2 minutes).
- Use CloudWatch Logs Insights to search logs for correlated error messages.
- Inspect X‑Ray traces to identify which database calls or connection pools are causing timeouts.
- Root cause example: application fails to close DB connections in error path → fix: code change or add a managed pooling layer (RDS Proxy).


- Compliance (long-term retention): Archive CloudWatch Logs to S3/Glacier for long retention (e.g.,
7 yearsfor SOX) while keeping a shorter retention in CloudWatch (e.g.,90 days) for fast access.

- Cost optimization at scale: For very large log volumes (e.g., 10 TB/day) use sampling and filtering at the source, send errors and important events to CloudWatch for alerts, and stream bulk INFO debug logs to S3 for cheaper batch processing.

- Multi-account aggregation: Use centralized logging patterns — cross-account CloudWatch dashboards, centralized logging accounts, or Control Tower/landing zone patterns — to build a single monitoring view across many accounts.
- Real-time vs batch analytics: Stream logs to Lambda (near real-time processing and alerting) and, in parallel, store logs in S3 and query with Athena/Glue for historical analytics and compliance reporting.

- Multiple subscription filters per log group: subscription filters forward logs to a destination. If you need multiple targets, implement a fan-out layer (e.g., Kinesis Data Streams/Firehose or a Lambda multiplexer) to distribute events.
- Storing everything forever: unlimited retention is expensive. Implement lifecycle rules and tiering (hot/warm/cold) to control costs.
- No structured logging: unstructured text logs make correlation and analytics difficult. Use JSON or a defined schema with correlation IDs.
- Tracing everything: full tracing for every request can create cost and noise. Use adaptive sampling and enable full tracing selectively.
Avoid unbounded retention and high-cardinality metrics. Both lead to runaway costs and slow queries — plan retention policies and dimension strategies early.

- Foundations of observability and the three pillars
- Collecting and storing logs at scale (CloudWatch Logs, S3, Athena)
- Metrics, dashboards, alarms, and notifications (CloudWatch Metrics, Alarms, Synthetics)
- Tracing and Application Insights (AWS X‑Ray, ServiceLens, ADOT)
- Real-time analysis, alerting, auditing, and long-term retention strategies

- Metrics tell you WHAT is happening — numerical, time-series signals used for alerting and performance monitoring.
- Logs explain WHY it happened — diagnostic context, state changes, and audit trails; structured logs and correlation IDs are essential.
- Traces show WHERE it happened — distributed request flows and service dependencies to pinpoint latency and failures.
- Combine metrics, structured logs, and selective tracing with dashboards and event correlation to detect, diagnose, and resolve incidents quickly.

- AWS CloudWatch Documentation: https://docs.aws.amazon.com/cloudwatch/
- AWS X‑Ray Documentation: https://docs.aws.amazon.com/xray/
- OpenTelemetry: https://opentelemetry.io/
- AWS Distro for OpenTelemetry (ADOT): https://aws.amazon.com/otel/