Skip to main content

AWS metrics from CloudWatch

Overview​

AWS Metrics from CloudWatch integration polls all your metrics from the specified AWS account every 10 minutes. This does not include S3 metrics, which are available on CloudWatch daily. Tags and metric definitions are pulled every 5 minutes.

Before you can use this integration, you must create an AWS IAM policy and role with the cloudwatch-metrics-iam-role Terraform module. The module outputs coralogix_metrics_role_arn and external_id, which provide the AwsRoleArn and ExternalId parameters below.

Using CloudFormation

You can create the same policy and role with the Coralogix CloudFormation template instead. For both options, see AWS CloudWatch metrics.

How to use with Terraform​

To deploy this integration using Terraform, you can use the coralogix_integration resource provided by the Coralogix Terraform provider. Below is an example configuration:

resource "coralogix_integration" "aws-metrics-collector" {
integration_key = "aws-metrics-collector"
version = "1.0.1"

parameters = {
IntegrationName = "cx-aws-cw-metrics"
AwsRoleArn = "arn:aws:iam::012345678901:role/access-cloudwatch-metrics"
AwsRegions = [ "eu-west-1" ]
ApplicationName = "<ApplicationName>"
SubsystemName = "<SubsystemName>"
MetricNamespaces = [ "AWS/EC2", "AWS/RDS" ]
Statistics = [ "Maximum", "Minimum", "SampleCount", "Sum", "Average" ]
WithAggregations = false
EnrichWithTags = true
DiscoverNamespaces = false
IncludeLinkedAccounts = false
PruneListedMetrics = false
}
}

Replace the placeholder values with your actual configuration parameters. Refer to the parameter table below for required fields and their descriptions.

With integration version 1.0.1 or later, set PruneListedMetrics = true and run terraform apply to enable Skip less detailed metrics. Leave it false to retain all rollups. To disable it, set it back to false and apply again. This restores future collection; data skipped while enabled is not backfilled.

Revisions​

Adds optional PruneListedMetrics (Boolean, default false), exposed as Skip less detailed metrics in Advanced settings. Enable it to remove less specific rollups only when their dimension names and values match a more specific series in the same namespace, metric name, and AWS account. Unrelated resources are retained. Comparisons occur within each discovery batch; rollups discovered in separate batches may remain.

Pruning can reduce collected metrics and CloudWatch API usage, but dimension containment does not guarantee equivalent data. Less specific rollups can contain additional data; removing them can cause missing aggregates or undercounting in dashboards and alerts. For example, Lambda's FunctionName metrics aggregate all versions and aliases, while Resource and ExecutedVersion select narrower views. See AWS Lambda metric dimensions.

Pruning was disabled by default in 0.6.0 to retain these metrics and preserve parity with Amazon Data Firehose. Keep it disabled if you need complete rollups or Firehose parity; review affected dashboards and alerts before enabling. The setting is retained across integration updates and upgrades. No new AWS permissions are required.

NameTypeRequiredDescription
ApplicationNameStringYesThe application name to be used in the integration. Added as the cx_application_name label to each metric.
AwsRegionsListYesSpecify the AWS regions to scan. Scanning a region may incur additional cost even if no resources are available in that region. Assuming the role must be allowed on all selected regions.
AwsRoleArnStringYesThe ARN of the role that trusts the Coralogix AWS account.
DiscoverNamespacesBooleanYesEnable this option to automatically discover and collect metrics from all available CloudWatch and custom namespaces for your AWS account. This may increase AWS costs and metrics may take time to appear as namespaces are discovered.
EnrichWithTagsBooleanYesAdd resource tags as labels to specific resource metrics.
IncludeLinkedAccountsBooleanYesIf your account is a CloudWatch Monitoring Account, you can enable this option to try to fetch metrics from all linked accounts.
IntegrationNameStringYes
MetricNamespacesListYesSelect the metric namespaces to specify which metrics to collect. If left empty, no metrics will be collected.
StatisticsListYesSelect statistics to be collected
SubsystemNameStringYesThe subsystem name to be used in the integration. Added as the cx_subsystem_name label to each metric.
WithAggregationsBooleanYesAdd optional aggregation metrics for Minimum and Maximum statistics. This will create additional metrics with suffixes _min and _max. Note that this can result in increased data usage. The same data results can be achieved using queries.
CustomMetricNamespacesStringNoEnter your custom metric namespaces to specify which metrics to collect. If left empty, no metrics will be collected.
EcsEnhancedMonitoringEnabledBooleanNoEnable ECS Enhanced Monitoring for additional metrics and ECS service and container_instances tags. Note that this will result in increased data usage. The following permissions are required: ecs::Describe and ecs::List. Permissions without an *` can be found in the changelog.
ElastiCacheEnhancedMonitoringEnabledBooleanNoEnable ElastiCache Enhanced Monitoring for additional metrics. Note that this will result in increased data usage. The following permissions are required: elasticache:DescribeCacheClusters, elasticache:ListTagsForResource and ec2:DescribeInstanceTypes.
ExtendedStatisticsToCollectJSONNoEnter a JSON-formatted string containing additional statistics, they will be collected only for metrics matching selected Metric Namespaces. If you do not want any additional statistics put [] as a value. Example: [{"metric_selector":{"namespace": "AWS/EC2", "metric_names": ["CPUUtilization"]}, "extended_statistics": ["p99"]}]. Supported statistics are ["p99", "p95", "p90", "p80", "p70", "p50"].
ExternalIdStringNoThe ExternalId used for assuming the AWS role. Must end with '@<your_company_id>' to bind the role to your Coralogix team. This value is generated by the CloudFormation template in the format '<secret>@<company_id>'.
MetricSelectorsJSONNoEnter a JSON-formatted string containing specific metric selectors. This configuration helps limit metrics collected per namespace. If you define a namespace in both "Namespaces" and here, only the metric_names specified here will be collected. We do not support duplicate metric selector configurations per namespace.
PollIntervalMinutesNumberNoWhile polling as frequently as every 3 minutes is technically possible, this can result in substantially higher AWS costs without meaningful improvements in monitoring timeliness. More frequent polling increases AWS CloudWatch API costs significantly, as each poll generates API requests that are charged by AWS. Additionally, CloudWatch metrics typically have up to 3 minutes delay before appearing in AWS, so polling more frequently than every 3-5 minutes provides minimal benefit while driving up costs unnecessarily. For cost-effective monitoring, intervals of 10 minutes are recommended for most use cases.
PruneListedMetricsBooleanNoKeep the most specific dimension sets per resource to reduce collected metrics and CloudWatch API usage. Disabled by default. Less specific rollups can contain additional data; pruning can remove aggregates or cause undercounting and breaks parity with Amazon Data Firehose. Review affected dashboards and alerts before enabling.
RdsEnhancedMonitoringEnabledBooleanNoEnable RDS Enhanced Monitoring for additional metrics and RDS provisioned and reserved instance tags. Note that this will result in increased data usage. The following permissions are required: rds::Describe*, rds::List*, and ec2:DescribeInstanceTypes. Permissions without an * can be found in the changelog.
ResourceTagsFilterStringNoEnter a comma-separated list of tag keys or key-value pairs to use as filter. A resource matches if it has at least one of the listed tags. Metrics on resources not matching the filter will be skipped. Note that not all metrics are linked to resources, this filter will have no effect on them. If no filter is defined, ALL metrics will be collected.
StaticLabelsListNoList of key-value pairs that will be added as labels to every metric in the integration.
TagsKeyFilterListNoEnter a comma-separated list of tag keys. Only tags matching these keys will be added as labels to the metrics. If empty, all of the tags will be added.
Last updated on
Was this page helpful?