Skip to content

Observability on AWS

Your app on AWS produces three kinds of telemetry. Logs are lines your code writes. Metrics are numbers over time, like invocations or queue depth. Traces follow one request through your services. AWS services report their own metrics and logs to CloudWatch without being asked; your code adds its own over OpenTelemetry. Alarms, dashboards and SLOs then watch what’s stored.

Take one small app: an Api Function behind a function URL, sending jobs to a Queue. Lambda writes Api’s output to a log group and publishes its invocation and error metrics. Api exports its own spans and metrics over OpenTelemetry. An alarm watches the error metric, and an SLO tracks how many requests succeed.

Signal Who sends it Where it’s stored Page
Logs Every Function and Task, automatically; your code over OpenTelemetry CloudWatch Logs log groups Logs
Service metrics Every AWS service, automatically CloudWatch metrics CloudWatch
Your own metrics Your code over OpenTelemetry CloudWatch’s OpenTelemetry metrics, queried with PromQL OpenTelemetry
Traces Your code over OpenTelemetry CloudWatch Logs (aws/spans), with Transaction Search on Traces
Prometheus metrics A scraper, or your code’s remote write Amazon Managed Service for Prometheus Prometheus & Grafana
You want Use Page
To be told when a metric crosses a line A CloudWatch alarm CloudWatch
Graphs of the metrics you care about A CloudWatch dashboard, or Grafana CloudWatch, Prometheus & Grafana
A reliability target and its error budget An SLO SLOs
One place for people to explore telemetry and own SLOs CloudWatch Omni CloudWatch Omni
To know your site is up and fast for real users A Synthetics canary, a RUM app monitor Canaries & real-user monitoring

Each of these is a resource, declared next to what it watches. A dashboard’s metrics name the Function it graphs, an alarm’s dimensions come from the Function’s name, and each stage gets its own copies:

alchemy.run.ts
const api = yield* Api;
yield* AWS.CloudWatch.Alarm("ApiErrors", {
Namespace: "AWS/Lambda",
MetricName: "Errors",
Dimensions: [{ Name: "FunctionName", Value: api.functionName }],
Statistic: "Sum",
Period: 60,
EvaluationPeriods: 1,
Threshold: 1,
ComparisonOperator: "GreaterThanOrEqualToThreshold",
});

Start with CloudWatch for what AWS records for you, then OpenTelemetry for what your code reports.