Level: Advanced
Estimated time: 2 to 3 weeks
Skills: OpenTelemetry, Prometheus and PromQL, Grafana, distributed tracing, log centralisation, SLOs and error budgets, burn-rate alerting, on-call routing, Terraform
AWS services: Amazon EKS or Amazon ECS, Amazon Managed Service for Prometheus (or self-hosted Prometheus), Amazon Managed Grafana (or self-hosted Grafana), Amazon CloudWatch Logs, AWS X-Ray, Amazon SNS, AWS IAM, Amazon S3
Last Saturday, ShopNest's checkout was failing for about 40 minutes. The engineering team found out when a customer posted a screenshot on social media. Monitoring today is a handful of CPU alarms that fire constantly, so everyone has muted them.
The incident review listed these problems:
- No user-facing signals. Nobody measures error rate or latency of the checkout flow.
- Logs are spread across services with different formats and no request ID, so tracing a failed order took hours.
- No distributed tracing. Checkout calls cart, inventory and payment services, and nobody could tell which one was slow.
- Alerts are noisy, have no owner and no runbook. The on-call engineer did not know the alert was important.
- Nobody can say how reliable checkout should be, so nobody can say whether a release made it worse.
The CTO wants ShopNest to detect customer-impacting problems before customers do, with alerts that are rare, actionable and routed to the right person.
Instrument a sample microservice application with OpenTelemetry, collect metrics, logs and traces centrally, build Grafana dashboards, define two SLOs for checkout (availability and latency), and alert on error-budget burn rate with runbook links and on-call routing. Prove it works by injecting failures and showing the right alert reaches the right person with enough context to act.
- A running EKS or ECS environment for the demo app (reuse the one from Build a Kubernetes Platform or Secure Three-Tier Application on ECS), and a sandbox AWS account with an AWS Budgets alert.
- Terraform 1.11 or newer, kubectl or the ECS CLI, the AWS CLI, and a load generator.
- Comfortable with: PromQL basics, reading a trace, structured logging, the idea of an error budget.
- Week 1, days 1 to 3: demo app running, OpenTelemetry Collector deployed, all four services sending OTLP, one end-to-end trace.
- Week 1, days 4 to 5: Prometheus backend, RED recording rules, structured logs with trace IDs collected centrally.
- Week 2, days 1 to 2: Grafana with SSO, three dashboards as code, exemplars or trace links.
- Week 2, days 3 to 5:
SLO.md, burn-rate alerts, Alertmanager routing, runbooks, both failure tests with evidence. - Week 3: cleanup of noisy alarms, on-call schedule doc, evidence, teardown, then open
change-request.md.
Milestones are a pacing guide, not extra requirements. Record the date you reach each one; it makes a better story for your README and your interviews.
- Four services (frontend, cart, inventory, payment) running on EKS or ECS. Any small demo app is fine; you may use an open source microservice demo.
- CloudWatch default metrics only. CPU alarms at 70% that fire several times a day.
- Each service logs plain text to stdout in its own format.
- No traces, no dashboards, no SLOs, no on-call rota.
Services emit telemetry through OpenTelemetry to a collector, which sends metrics to Prometheus and traces to a tracing backend. Logs carry the trace ID so an engineer can jump from a dashboard spike to a trace to the exact log lines. SLO recording rules feed burn-rate alerts, and Alertmanager routes fast burns to a page and slow burns to a ticket.
- All four services instrumented with OpenTelemetry SDKs (automatic instrumentation is fine, plus at least one custom span and one custom metric for a business event such as "order placed").
- Telemetry is sent over OTLP to an OpenTelemetry Collector (AWS Distro for OpenTelemetry or upstream). Services do not send directly to vendor backends.
- Consistent resource attributes on all signals:
service.name,service.version,deployment.environment. - Trace context propagates across all service calls (W3C Trace Context).
- Prometheus-compatible storage: Amazon Managed Service for Prometheus or self-hosted Prometheus. Justify your choice (operational effort, retention, cost model, alerting features).
- RED metrics (rate, errors, duration) per service and per endpoint, using histograms for latency.
- Infrastructure metrics for nodes or tasks and containers.
- Watch label cardinality. Do not use user IDs, order IDs or full URLs as metric labels.
- Structured JSON logs with at least: timestamp, level, service, message,
trace_id,span_id. - Logs from all services collected centrally (CloudWatch Logs, Loki or OpenSearch). Retention set on every log group or index.
- No secrets or full card numbers in logs. Show how you checked.
- Traces visible end to end for a checkout request across all four services.
- A sampling strategy documented (for example keep all error traces, sample a percentage of successful ones).
- From a trace you can open the related logs, and from a latency panel you can open an example trace (exemplars or trace links).
- Grafana (Amazon Managed Grafana or self-hosted). Access through SSO or authenticated users only, not anonymous.
- Dashboards stored as code (JSON in Git or Terraform-managed), not only edited in the UI.
- At least:
- Checkout SLO dashboard: SLI, SLO target, error budget remaining, burn rate.
- Service overview: RED metrics for each service.
- Infrastructure: CPU, memory, restarts or task stops.
- Two SLOs for the checkout flow, written in an
SLO.mdwith the SLI definition, target, window and rationale:- Availability: for example the proportion of checkout requests that do not return 5xx, over 28 or 30 days.
- Latency: for example the proportion of checkout requests served under a threshold you choose, over the same window.
- SLIs measured from a point close to the user (load balancer or frontend), not only inside one backend service.
- Prometheus recording rules compute the SLIs over multiple windows.
- Multi-window, multi-burn-rate alerts for each SLO: at least one fast-burn alert (pages) and one slow-burn alert (ticket or chat). Document the burn-rate thresholds and windows and why.
- Every alert has: severity, owning team, a summary that says what the user impact is, and a
runbook_urlannotation linking to a runbook in your repo. - Write a runbook for each alert: what it means, how to confirm, dashboards and queries to check, likely causes, mitigation steps, escalation.
- Remove or demote the noisy CPU alarms. CPU alone should not page anyone.
- Alert rules stored in Git and deployed by Terraform or CI.
- Alertmanager routes alerts by severity and team: pages to an on-call destination, low-severity alerts to a chat channel or ticket queue.
- With Amazon Managed Service for Prometheus, its alert manager sends notifications to Amazon SNS; forward from SNS to your on-call or chat tool. With self-hosted Alertmanager you may use its native receivers.
- Grouping and inhibition configured so one outage does not create dozens of pages.
- A simple on-call schedule documented (a free tier of an on-call tool, or a documented email or SMS rotation via SNS).
- Terraform for the workspace, IAM roles, log groups, SNS topics and Grafana setup. Collector configuration in Git.
- Collectors and services get AWS permissions through EKS Pod Identity or ECS task roles. No access keys.
- A single checkout request produces one trace that spans all four services (screenshot).
- From that trace, the matching log lines are found by
trace_id(screenshot or query output). - The SLO dashboard shows SLI, target, error budget remaining and burn rate for both SLOs.
- Failure test 1: injecting errors into the payment service fires the fast-burn availability alert within the time you predicted, and it reaches the on-call destination.
- Failure test 2: injecting latency fires the latency SLO alert, and the trace view shows which service is slow.
- Every alert received contains severity, team, user impact summary and a working runbook link.
- A slow-burn alert goes to the chat or ticket destination, not the paging destination.
- Dashboards and alert rules can be recreated from Git after deleting them.
- No metric label uses a high-cardinality value such as user or order ID (show the label list for your custom metrics).
- OpenTelemetry for application instrumentation. No vendor-specific SDKs in application code.
- No AWS access keys. Use Pod Identity, task roles, or OIDC for CI.
- Dashboards and alerts as code.
- No paging alerts on CPU, memory or other cause-based metrics alone.
- Building the microservice app from scratch (use or adapt a demo app).
- Commercial APM products.
- Synthetic monitoring from multiple regions (a single synthetic check is a welcome extra).
- Long-term metrics storage beyond the default retention of your chosen backend.
In a real job, requirements change while you are building. This project has one change request. It is stored in change-request.md in this folder.
Do not read it until you have finished the main requirements (the last milestone above says when). Opening it early removes the point of the exercise, which is adapting a finished design to a new requirement.
- Terraform for observability infrastructure.
- OpenTelemetry Collector configuration and instrumented service code.
- Grafana dashboards as code.
- Prometheus recording rules and alert rules.
- Alertmanager routing configuration.
SLO.mdwith both SLOs, error budget policy and burn-rate math.- A
runbooks/folder with one runbook per alert. - Architecture diagram and README.
evidence/folder with screenshots and alert notifications from both failure tests.- A 5 to 10 minute demo video: inject a failure, receive the page, follow the runbook to the root cause.
- All acceptance criteria evidenced.
- SLOs and alert thresholds reviewed by a peer (or a documented self-review).
- Change request implemented and tested.
- Runbooks written for every alert.
- All resources destroyed after the demo, with proof.
Billed while running:
- The EKS control plane (hourly) or ECS Fargate tasks, plus worker nodes and load balancers (hourly).
- NAT gateways and interface VPC endpoints if used (hourly).
- Amazon Managed Service for Prometheus bills by samples ingested, storage and query samples processed. High-cardinality metrics increase cost directly.
- Amazon Managed Grafana bills per active user license.
- CloudWatch Logs ingestion and storage, X-Ray traces recorded and retrieved, SNS messages.
Turn down the load generator when not testing, set log retention, and run terraform destroy after the demo. Delete the Prometheus workspace and Grafana workspace explicitly if they were created outside Terraform, and show proof that they are gone.
- OpenTelemetry documentation
- AWS Distro for OpenTelemetry
- Amazon Managed Service for Prometheus
- Amazon Managed Grafana
- Google SRE Workbook: Alerting on SLOs (burn-rate math)
- Terraform S3 backend and
use_lockfile - GitHub Actions OIDC with AWS
Official documentation only. If a tool behaves differently from what this brief says, the documentation wins; open an issue so the brief can be corrected.
Built end-to-end observability for ShopNest's 4-service checkout with OpenTelemetry, Prometheus, Grafana and distributed tracing; defined availability and latency SLOs with burn-rate alerts and runbooks, cutting time to detect an injected payment outage from 40 minutes (customer report) to under 5 minutes and reducing pages from 10 a day to 1 a week. Replace the numbers with your own measured results.
- What is the difference between an SLI, an SLO and an error budget? How did you choose your targets?
- Why alert on burn rate instead of a fixed error-rate threshold? Explain your fast-burn and slow-burn windows.
- How do metrics, logs and traces connect in your setup? How do you go from a spike to a root cause?
- What is label cardinality, and how can it hurt a Prometheus-based system?
- Why should a CPU alert not page someone at night?
- How did you decide your trace sampling strategy?
Part of Real DevOps Projects. Build it, push it to your own GitHub, and add it to your resume. Use the evidence template, the demo video guide and the self-review checklist.
