Ingest CloudWatch Metrics
groundcover supports ingesting CloudWatch metrics directly into our platform, allowing you to visualize them using dashboards and create monitors.
Before setting thresholds on aws_* series, see Alerting on CloudWatch metrics - the CloudWatch period and the polling lag both affect which monitor settings work.
How does it work
CloudWatch integration is done by deploying a service called integrations-agent which is responsible for pulling metrics from CloudWatch using periodic polling of these APIs:
The integration setup is done directly through the App by following these steps:
Navigate to the Data Sources page or follow this link. Note that only users with Admin permissions can navigate to this page.
Select Amazon Web Services and follow the wizard steps. Note that in step 1 you'll need to provide an ARN, granting groundcover with permissions to poll metrics. To do that, please follow the guidelines in this section.
Things to know
Ingestion interval
The integration pulls data from CloudWatch according to this interval. The lower the interval, the higher the polling rate and as a result, the overall costs will be higher. The interval can be altered in the Advanced Settings in the configuration wizard.
Data storage
Data fetched is stored in the Victoria Metrics database, meaning metrics are queried via the CloudWatch API only one time per data point.
Metric Statistics
Each metric has a label called stat which denotes the AWS statistic used during querying. Some metrics have multiple stats which are useful for different cases.
Supported AWS services
Resource Discovery Methods
groundcover seamlessly integrates both methods below to avoid duplicate metric fetching.
The integration uses two methods to discover the AWS resources to fetch metrics for:
Tagging-based discovery - this method uses the AWS tagging mechanism to discover resources across all metric namespaces. This method supports all AWS namespaces but only works for resources which are tagged with at least one AWS tag.
List-based discovery - this method uses standard AWS APIs to list the resources in each namespace. It works for all resources regardless of tags, but the coverage is limited to specific namespaces as listed below:
AWS/RDS
AWS/S3
AWS/SQS
AWS/Lambda
AWS/ElastiCache
AWS/DynamoDB
AWS/ELB
AWS/NetworkELB
AWS/ApplicationELB
Scoping tagging-based discovery to specific resources
By default, tagging-based discovery picks up every tagged resource in a namespace. To narrow this down, add one or more search tags in the wizard's tag step: each is a tag key plus a value, where the value is matched as a regular expression rather than an exact string. Only resources with a tag matching both the key and the value pattern are scraped. For example, a tag key team with value pattern platform.* matches resources tagged team=platform, team=platform-core, and so on, but not team=data.
Create an IAM role and policy
Follow the below guidelines to set up a role manually, or configure it using CloudFormation using this script.
Go to Amazon IAM
Click on Roles in the side bar
Click on Create Role
Select Custom trust policy
Paste the following policy:
Click on Next twice (we'll attach permissions later)
Provide a name for the role
Click on Create Role
Go to your newly created role
In the Permissions section, click on Add permissions and then Create inline policy
Click on JSON and paste the following:
Click on Next
Give the policy a name
Click on Create Policy
Alerting on CloudWatch metrics
CloudWatch stamps each datapoint at the start of the period it covers - often 5 minutes - and the datapoint only reaches groundcover on the next poll, one ingestion interval later. A monitor evaluates the last few minutes of data at the moment it runs, not the chart you look at afterwards, so monitors built on aws_* metrics need settings that account for both.
Recommended settings
Evaluation delay
At least the metric's CloudWatch period plus the ingestion interval set for the integration, so the datapoint has arrived by the time the monitor looks for it. 900 (15 minutes) is what the wizard prefills for metrics named aws_* and covers a 5-minute period at the default interval - raise it if you lengthened the ingestion interval. Monitors created from YAML, the API or Terraform must set it explicitly.
Evaluation interval
Match the CloudWatch period of the metric - 5 minutes for most, 1 minute where detailed monitoring is enabled.
Rollup window
Match the same period.
Treat No Data As
Avoid Normal if you need to know when the evaluation window is empty.
Match the evaluation interval to the CloudWatch period
CloudWatch datapoints are sparse compared to a 1-minute evaluation interval, which makes an interval shorter than the rollup window the default trap here: the same datapoint is counted on consecutive evaluations, and a sum rollup returns a multiple of the value CloudWatch reported - a metric that reported 30 evaluated as 150, with a threshold tuned against a number the metric never had. Matching the interval to the rollup window removes the duplication. See Dashboard shows different values than monitor for the general case.
A 1-minute chart of a 5-minute metric also stays flat between datapoints. That plateau is one value carried forward, not extra samples.
Expect issues to lag the CloudWatch timestamp
With an evaluation delay of 15 minutes and no pending period, an issue opens roughly 15 minutes after the timestamp CloudWatch assigned to the datapoint that crossed the threshold, and proportionally later if a longer delay covers a longer ingestion interval. That gap is the cost of waiting for data that arrives late, and it is expected. A pending period adds its own duration on top.
Decide what an empty window means
A poll that lands later than usual leaves the evaluation window empty. With Treat No Data As set to Normal that is indistinguishable from a healthy evaluation and the monitor stays green, so a missed datapoint passes silently. See Treat No Data As for the alternatives and Alerting on No Data for notifying on them.
No Data applies to the query as a whole. A query grouped by resource keeps returning rows while any one resource still reports, so a single load balancer that stops publishing is not a No Data evaluation.
Example monitor
CloudWatch metric names are ingested as aws_<namespace>_<metric> in lower snake case, and each series carries a stat label for the AWS statistic it was queried with. Filter on stat so a metric with multiple statistics does not return several series per resource.
See Monitor YAML structure for the full schema.
Last updated
