Architecture pattern library

AWS field guide

Design observability around user impact

Start from user-visible outcomes, then connect the minimum useful metrics, traces, and logs to those objectives.

Use this pattern when

A distributed workload has several dependencies or failures are difficult to reproduce.

Reference architecture

Responsibilities and controls, not a deployment template.

Synchronous Asynchronous

User request

Outcome to protect

AWS X-Ray

Correlation and traces

Amazon CloudWatch

Metrics and structured logs

Service objective

Latency and errors

CloudWatch alarm

Owned, actionable signal

AWS service marks use the official Q3 2026 AWS Architecture Icons. Abstract nodes represent application responsibilities rather than AWS services.

Decisions that shape the pattern

  • Define a small set of service-level indicators.
  • Use structured logs with correlation IDs.
  • Sample high-volume traces intentionally.

Security boundaries

  • Redact sensitive fields before logging.
  • Restrict log access and exports.
  • Set retention by operational and compliance need.

Reliability posture

  • Alert on symptoms before causes.
  • Test alerts and runbooks.
  • Keep telemetry failure from breaking the workload.

Starter implementation

Start from deployable infrastructure

Review every permission, limit, Region, and cost assumption before production.

Download ADR template
operational-observability.stack.ts
import { Duration, Stack, StackProps } from 'aws-cdk-lib';
import * as apigateway from 'aws-cdk-lib/aws-apigateway';
import * as athena from 'aws-cdk-lib/aws-athena';
import * as bedrock from 'aws-cdk-lib/aws-bedrock';
import * as budgets from 'aws-cdk-lib/aws-budgets';
import * as cloudfront from 'aws-cdk-lib/aws-cloudfront';
import * as origins from 'aws-cdk-lib/aws-cloudfront-origins';
import * as cloudtrail from 'aws-cdk-lib/aws-cloudtrail';
import * as cloudwatch from 'aws-cdk-lib/aws-cloudwatch';
import * as dynamodb from 'aws-cdk-lib/aws-dynamodb';
import * as ecs from 'aws-cdk-lib/aws-ecs';
import * as patterns from 'aws-cdk-lib/aws-ecs-patterns';
import * as events from 'aws-cdk-lib/aws-events';
import * as targets from 'aws-cdk-lib/aws-events-targets';
import * as glue from 'aws-cdk-lib/aws-glue';
import * as iam from 'aws-cdk-lib/aws-iam';
import * as kms from 'aws-cdk-lib/aws-kms';
import * as lambda from 'aws-cdk-lib/aws-lambda';
import * as sources from 'aws-cdk-lib/aws-lambda-event-sources';
import * as s3 from 'aws-cdk-lib/aws-s3';
import * as secretsmanager from 'aws-cdk-lib/aws-secretsmanager';
import * as sqs from 'aws-cdk-lib/aws-sqs';
import { Construct } from 'constructs';

export class PatternStack extends Stack {
  constructor(scope: Construct, id: string, props?: StackProps) {
    super(scope, id, props);

    const errors = new cloudwatch.Metric({
      namespace: 'AWSMindset/Workload', metricName: 'UserVisibleErrors', statistic: 'Sum',
    });
    const alarm = new cloudwatch.Alarm(this, 'HighErrorRate', {
      metric: errors, threshold: 5, evaluationPeriods: 2,
      treatMissingData: cloudwatch.TreatMissingData.NOT_BREACHING,
    });
    const dashboard = new cloudwatch.Dashboard(this, 'Operations');
    dashboard.addWidgets(new cloudwatch.GraphWidget({ title: 'User-visible errors', left: [errors] }));
  }
}

Before production

Adoption checklist

  1. 01Define the user outcome.
  2. 02Choose latency and error indicators.
  3. 03Propagate correlation IDs.
  4. 04Set log retention.
  5. 05Attach an owner and runbook to every alert.

From the journal

Selected from service names and architecture signals used by this pattern.

Was this playbook useful?

One click helps prioritize deeper examples and updates.