Skip to main content

Overview

OpenSRE reads Amazon CloudWatch Logs to pull error tracebacks and correlated log lines from Lambda, ECS, Batch, or any other log group, and reads CloudWatch metrics for AWS Batch job queues. CloudWatch alarms also work as an alert source: OpenSRE takes the incident start time from the alarm’s StateUpdatedTimestamp, including when the alarm arrives wrapped in SNS or EventBridge. All CloudWatch calls are read-only.

Prerequisites

  • AWS credentials configured per the AWS integration
  • The absolute name of the log group you want inspected (for example /aws/lambda/checkout or /ecs/payments-api)
  • IAM permissions listed in IAM permissions

Setup

CloudWatch has no separate setup target. Configure the AWS integration. The CloudWatch tools become available when the investigation context contains a cloudwatch source:

Environment variables

Credentials

CloudWatch tools call AWS through the ambient boto3 credential chain (environment keys, shared credentials profile, or attached instance/task role). They do not assume AWS_ROLE_ARN for the API call, so grant the permissions below to the identity the OpenSRE process runs as.

IAM permissions

The AWS managed ReadOnlyAccess policy includes all of these.

Tools

Use cases

  • Pulling the traceback behind a failing Lambda or ECS task
  • Searching a log group for a correlation ID or ERROR pattern
  • Checking whether an AWS Batch queue was CPU- or memory-constrained

Gotchas

  • log_group must be the absolute name, starting with /. Short names are not resolved.
  • Filtered searches only look at the last 2 hours of events. For older incidents, give the stream name instead of a filter pattern.
  • For Kubernetes pod logs use EKS or Kubernetes, not CloudWatch, unless you ship container logs to CloudWatch with Container Insights or Fluent Bit.
  • For Lambda functions, prefer the dedicated Lambda tools, which derive the log group from the function name.

Verify

CloudWatch shares the AWS credential check; there is no separate cloudwatch verify target. A passing AWS verify confirms credentials, not log-group permissions, so a missing logs:* permission only shows up when a tool runs.

Troubleshooting

Security

  • All CloudWatch calls are read-only.
  • Log lines can contain secrets or personal data; scope logs:* permissions to the log groups OpenSRE needs (arn:aws:logs:<region>:<account>:log-group:<name>:*) if that matters in your environment.
  • Store AWS credentials in .env or your secret manager, not in source control.