
Amazon CloudWatch
Let AI connect your sources for you
Skip the manual setup — run this in your project and the wizard auto-detects your databases and APIs and connects them to PostHog.

Connect Amazon CloudWatch to PostHog to sync your data into the PostHog data warehouse for analysis and modeling.
Sync CloudWatch log groups, log streams, log events, metric filters, subscription filters, log anomalies, alarms, alarm history, metrics, metric datapoints, dashboards, anomaly detectors and Contributor Insights rules from one AWS region into the PostHog Data warehouse.
Create an IAM user or role with the logs:DescribeLogGroups, logs:DescribeLogStreams, logs:DescribeMetricFilters, logs:DescribeSubscriptionFilters, logs:FilterLogEvents, logs:ListAnomalies, cloudwatch:DescribeAlarms, cloudwatch:DescribeAlarmHistory, cloudwatch:DescribeAnomalyDetectors, cloudwatch:DescribeInsightRules, cloudwatch:GetMetricData, cloudwatch:ListDashboards and cloudwatch:ListMetrics permissions. Connect with the IAM role, or paste an access key ID and secret access key. Add a session token too if you are using temporary credentials.
Log events, log streams and subscription filters sync from the log groups you list, or from every log group in the region (up to 50) when the list is empty. A log group or metric query added later syncs from the next sync on; resync the table to backfill its history. Any log delivered to CloudWatch Logs works, including Bedrock model invocation logs and CloudFront standard logs. Metric datapoints sync for the metric queries you configure as JSON, for example [{"id": "cpu", "namespace": "AWS/EC2", "metric_name": "CPUUtilization", "dimensions": {"InstanceId": "i-0123456789abcdef0"}, "stat": "Average", "period": 300}]. S3 Storage Lens metrics live in the AWS/S3/Storage-Lens namespace. Older datapoints come back at the resolution CloudWatch keeps for them: 5 minutes after 15 days and 1 hour after 63 days.
Configuration
| Option | Description |
|---|---|
AuthenticationType: select Required: True | With an IAM role, PostHog reads with short-lived credentials and stores no key. Create a role connection with your role's ARN, then grant the role the permissions listed above. |
AWS regionType: text Required: True | |
Log groups to sync (one per line, empty syncs every log group)Type: textarea Required: False | |
Metric queries (JSON list)Type: textarea Required: False | |
Start date (defaults to 7 days back for logs, 14 for metrics, 30 for alarm history)Type: text Required: False |
Linking Amazon CloudWatch to PostHog
- Go to the Data pipeline page in PostHog
- Click New source and select Amazon CloudWatch
- Fill in the required configuration fields
- Click Next, select the tables you want to sync, and then press Import
Supported tables
| Table | Description | Sync method | Incremental field | Primary key |
|---|---|---|---|---|
log_groups | Log groups in the region, with retention, stored bytes and encryption settings. | Full refresh | — | — |
log_events | Log events from the configured log groups (or every log group when none is set), one row per event. | Incremental, Full refresh | timestamp | — |
alarms | Metric and composite alarms with their current state, thresholds and actions. | Full refresh | — | — |
alarm_history | State transitions, configuration updates and action executions for every alarm. | Incremental, Full refresh | timestamp | — |
metric_data | Datapoints for the metric queries configured on the source, one row per query and timestamp. | Incremental, Full refresh | timestamp | — |
metrics | Metrics in the region that received data in the last two weeks, with their namespace, name and dimensions. Use it to find metrics for the metric queries. | Full refresh | — | — |
log_streams | Log streams in the synced log groups, with their first and last event times. | Full refresh | — | — |
metric_filters | Metric filters in the region, which turn matching log events into CloudWatch metrics. | Full refresh | — | — |
log_anomalies | Anomalies that log anomaly detectors found in the log groups. | Full refresh | — | — |
subscription_filters | Subscription filters on the synced log groups, with the destination each one streams log events to. | Full refresh | — | — |
dashboards | CloudWatch dashboards in the account, with their last modified time and size. | Full refresh | — | — |
anomaly_detectors | Metric anomaly detection models in the region, for single metrics and metric math expressions. | Full refresh | — | — |
insight_rules | Contributor Insights rules in the region, with their state and rule definition. | Full refresh | — | — |





