AWS CloudWatch
Rocketgraph reads your CloudWatch alarms, metrics and logs, X-Ray service map and RDS databases with a read-only IAM user.
You connect AWS with one CloudFormation stack. It makes a read-only IAM user in your own account and sends its key to Rocketgraph. Nobody copies a key by hand.
Connect
- Open Connect and click AWS CloudWatch under Observability.
- Region: the region your services run in.
- Click Connect AWS. The AWS console opens a quick-create page for a stack called
rocketgraphin that region. - Tick the box that says the stack creates IAM resources, and click Create stack.
- When the stack finishes (about a minute), the connector shows as connected.
The stack creates:
- An IAM user with one inline policy,
RocketgraphReadOnly, and an access key for it. - A Lambda function and its role. It runs only when the stack is created or deleted, and sends the key to your Rocketgraph organisation over HTTPS.
If you can't create a stack
- Create an IAM user with the policy below. The Open IAM users button takes you there.
- Create an access key for it.
- Paste it into Or: access key ID and Secret access key, and click Connect AWS CloudWatch.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"cloudwatch:DescribeAlarms",
"cloudwatch:ListMetrics",
"cloudwatch:GetMetricData",
"logs:DescribeLogGroups",
"logs:StartQuery",
"logs:GetQueryResults",
"xray:GetServiceGraph",
"rds:DescribeDBInstances",
"rds:DescribeDBLogFiles",
"rds:DownloadDBLogFilePortion",
"pi:DescribeDimensionKeys"
],
"Resource": "*"
}
]
}
What Rocketgraph reads
The stack's policy allows these actions, all read-only:
| Area | Actions |
|---|---|
| Alarms and metrics | cloudwatch:DescribeAlarms, DescribeAlarmHistory, ListMetrics, GetMetricData, GetMetricStatistics |
| Logs | logs:DescribeLogGroups, DescribeLogStreams, DescribeQueryDefinitions, FilterLogEvents, GetLogEvents, StartQuery, StopQuery, GetQueryResults |
| Traces | xray:GetServiceGraph, GetTraceSummaries, BatchGetTraces |
| Inventory | tag:GetResources, sts:GetCallerIdentity |
| Databases | rds:DescribeDBInstances, DescribeDBClusters, DescribeDBLogFiles, DownloadDBLogFilePortion, pi:DescribeDimensionKeys, GetResourceMetrics, GetDimensionKeyDetails, ListAvailableResourceMetrics |
What it does with them:
- Services. Requests, errors and latency from three kinds of service:
- Application Load Balancer target groups:
RequestCount,HTTPCode_Target_5XX_Count,TargetResponseTime. - Lambda functions:
Invocations,Errors,Duration. - API Gateway:
Count,5XXError(or5xxfor HTTP APIs),Latency. REST APIs are named byApiName, HTTP APIs byApiId.
ECS and EC2 publish no request counts of their own, so a service there shows up through its load balancer's target group.
- Alarms. Every alarm in ALARM, and any that went back to OK recently, is read each cycle and treated like an alert from any other source. Alarms whose only actions are autoscaling policies are skipped.
- Endpoints. API Gateway per method and resource, when detailed metrics are on for the stage.
- Logs. Log volume per log group from AWS/Logs IncomingLogEvents. For a Lambda function that alerts, error lines from its log group through Logs Insights.
- Service map. The X-Ray service graph, if you use X-Ray.
- RDS and Aurora. Shown on the Postgres page. Rocketgraph never connects to the database. It reads:
- Every instance in the region, with the last hour of CPUUtilization, DatabaseConnections, FreeStorageSpace, FreeableMemory, ReadLatency, WriteLatency, ReadIOPS and WriteIOPS.
- For one instance you open: the top SQL by database load and the top wait events over the last hour, from Performance Insights.
- The last 1,000 lines of the instance's newest log file, keeping error, warning and slow-query lines.
Known limits
- One region per connection: the region the stack was created in.
- CloudWatch bills
GetMetricDatato your account, about $0.01 per 1,000 metrics. Rocketgraph asks for three metrics per service per cycle, so 100 services every five minutes is roughly $0.90 a day. - CloudWatch data arrives a minute or two late, so the newest point is often incomplete.
- Per-query detail for RDS needs Performance Insights turned on for that instance.
- Rocketgraph reads from one observability backend at a time. If your organisation already reads from another backend, the stack fails and says which one.
Disconnect
Delete the rocketgraph stack in CloudFormation. That removes the IAM user, which revokes its key, and tells Rocketgraph to disconnect.
If you used the access-key route, delete the access key or the IAM user in IAM.