Skip to content
topicPhase: ReleasePlatform

CI/CD & Observability — Monitoring as QA ​


title: CI/CD & Observability description: Pipeline design, automated scans, and monitoring-as-quality practices for CI/CD on AWS. ​

Pipeline design on AWS, automated scans at every stage, and a closed-loop observability system that treats production monitoring as continuous QA.

Reference template — no production code in this repo.
Operations cluster: operations-observability.md · Monitoring & tracing · Dashboards · Incidents · Monitoring as QA
Procedures to adapt: SOP-006 · SOP-007 · SOP-008


End-to-End Pipeline ​


AWS CI/CD Component Map ​

StageAWS serviceResponsibility
SourceCodeCommit / GitHubTrigger pipeline
BuildCodeBuildCompile, test, scan
ArtifactS3, ECRStore builds and images
OrchestrateCodePipelineStage sequencing
DeployCodeDeploy, ECS, EKSProgressive rollout
ConfigAppConfigFeature flags
SecretsSecrets Manager, SSMRuntime credentials — see Identity & access
IaCCDK / CloudFormationEphemeral + prod stacks

Automated Scans by Pipeline Stage ​

StageScansFail condition
Pre-commitgitleaks, lint, formatLocal block
PR — fastUnit, contract, secretAny failure
PR — buildSAST, SCA, licenseCritical/High
PR — integrationE2E, integrationAny failure
PR — reviewAI diff, OPAPolicy violation
Pre-deployContainer scan (ECR), IaC scanCritical CVE
Post-deploy stagingOWASP ZAP (DAST), syntheticAny critical finding
CanaryCloudWatch metric comparisonSLO breach

Ephemeral Environments ​

Each PR gets an isolated environment for integration and E2E tests:

  • Naming: preview-{pr-number}.{domain}
  • Cost control: auto-destroy after 24h idle or on PR close
  • Data: synthetic fixtures only; never prod snapshots with PII

Observability Stack on AWS ​


Monitoring-as-QA: Alert Logic ​

Production monitoring is a QA layer that catches what CI missed.

Alert types ​

AlertDetectionAction
New error classLog pattern not in baseline allowlistTicket + page if Tier 1
Latency regressionp99 > baseline + 2σ post-deployAuto-rollback if canary
Synthetic failureCanary step failsPage on-call
SLO burnError budget consumption rateFreeze deploys
Dependency failureX-Ray service map new red edgeTicket with trace link
Security signalGuardDuty findingSecurity page

Deploy comparison (metric diff) ​

After each deploy, automatically compare (15 min window vs prior 24h baseline):

  • Error rate by endpoint
  • p50/p99 latency
  • Saturation (CPU, queue depth)
  • Business KPIs (orders/min, conversion)

If regression detected during canary → automatic rollback without human action. Human triage follows for root cause.


Closed-Loop: Alert → Fix → Prevent ​

Auto-ticket contents (AI-generated) ​

  • Alert summary and timeline
  • Deploy correlation (sha, time, author)
  • Top relevant log lines and trace IDs
  • Suggested root cause (labeled as hypothesis)
  • Link to runbook
  • Draft regression test stub

Human-in-the-Loop: Operations ​

EventAutomatedHuman
Canary metric regressionRollbackReview post-incident
New error class alertTicket createdConfirm severity, assign
SLO burn alertDeploy freezeApprove exception if needed
Security GuardDuty criticalSNS pageInvestigate, contain
PostmortemAI draftSRE + team edit and publish
Monitoring baseline updateAuto after 7d stableHuman override if false positive pattern

Dashboard Requirements ​

Every Tier 1 service dashboard includes:

  1. Golden signals — latency, traffic, errors, saturation
  2. SLO status — error budget remaining
  3. Deploy markers — correlate releases with metric shifts
  4. Synthetic check status — last 24h pass rate
  5. Open alerts — linked to tickets
  6. Contract test status — last CI run against spec

SNS / EventBridge Routing ​

yaml
# Conceptual EventBridge rule
source: aws.cloudwatch
detail-type: CloudWatch Alarm State Change
detail:
  state:
    value: ALARM
  alarmName:
    prefix: "prod-"
targets:
  - PagerDuty API destination (Tier 1)
  - SNS → Slack (all tiers)
  - Lambda → create Jira ticket with AI summary
  - Lambda → check if alarm fired within 30m of deploy → trigger rollback

Compliance & Audit Trail ​

RequirementImplementation
Who deployed whatCodePipeline + CloudTrail
Scan results archivedS3 bucket per build artifact
Test resultsCodeBuild reports in S3
ADR at time of deployGit sha links spec + ADR versions
Alert historyCloudWatch alarm history + ticket system

Reference template only — no production code. Adapt in your own project.