Export CloudWatch metrics

Chronosphere supports exporting metrics from Amazon CloudWatch by using Terraform.

You can use Terraform to define jobs to export metrics from CloudWatch. This includes defining with which role to scrape the metrics, the labels for the search, the regions, and which labels to export.

By default, CloudWatch exports all metrics in a namespace. To exempt specific metrics from being exported by CloudWatch, list each of them in the Terraform resource as separate disable_metrics fields.

resource "chronosphere_export_job" "first" {
  name        = "first-name"

  cloudwatch_job {

    // What metric namespace to look in.
    namespace = "EC2"

    // What regions this applies to.
    regions = [
      "us-east-1",
      "us-west-1",
    ]

    // What AWS role(s) should Chronosphere assume to access your metrics.
    role {
      arn         = "arn:aws:iam::012345678910:role/test-arn"
      external_id = "open sesame"
    }

    // Other roles! (optional)
    role {
      ...
    }

    // What label and value pairs should we use to filter resources.
    search_labels = {
      "env" = "production"
    }

    // What AWS tags to preserve.
    labels = [
      "awesome", "possum",
    ]

    // Metric(s) in the namespace that we do not want to export.
    disabled_metric {
      name      = "metric_name"
      statistic = "p99"
    }

    // Other disabled metric(s).
    disabled_metric {
      ...
    }
  }
}