

Some metrics such as those for S3 are only provided once a day, so range_seconds and period_seconds need adjusting to pick them up. Some Dynamo metrics have different semantics depending on which dimensions are specified, deviating from the Cloudwatch data model (don't worry, the Cloudwatch exporter has a hard-coded workaround for this). Determining which statistic you want for a given metric can be tricky, and not all metrics have all potential combinations of dimensions available. Another is the data model, rather than exposing a 0 Cloudwatch will often not expose a result at all which (as with Prometheus generally) can be tricky to deal with. Getting data from Cloudwatch can also be relatively slow, so limit what you pull in. The cloudwatch_requests_total metric helps you track this. There are several disadvantages to Cloudwatch, One issue is cost, every API request that the Cloudwatch exporter makes to Cloudwatch costs $0.00001 which can add up surprisingly quickly with regular scrapes. Honor_labels is used here so that the metrics from Cloudwatch don't end up with the instance label of the exporter. Scraping the Cloudwatch exporter from Prometheus is mostly standard: scrape_configs: You can add an offset 10m to the vector selector to access the values, or specify set_timestamp: false in the Cloudwatch exporter configuration file on a per-metric basis. Aside from the usual issues with exposed timestamps such as staleness not working, this also means that recording rules/alerts won't pick up the values. Exposing that with no timestamp would have data be off by 10 minutes which would be misleading, as that's a bit much to get away with.

The particular issue with Cloudwatch is that it is a monitoring system and it has been observed to take up to 10 minutes for values to converge, and as Prometheus has an append-only database this means we have to request 10 minute old data. Timestamps are not something that an exporter should typically expose, as scrapes should be synchronous.

cloudwatch_exporter_scrape_error being 0 indicates that the scrape was successful:Īn important thing to note here is the timestamps that are exposed on the Cloudwatch metrics. If you visit :1234/metrics you will see some metrics, presuming you are using one of the services covered by the example config. This is using example configuration file, which looks at the eu-west-1 region out of the box so adjust as needed. Java -jar cloudwatch_exporter-0.6.0-jar-with-dependencies.jar 1234 example.yml
#Cloudwatch prometheus exporter download
We can now download and run the exporter: wget There's a few ways to provide the credentials, one is to use credential profile files: $ aws configureĪWS Access Key ID : enter_your_access_key_hereĪWS Secret Access Key : enter_your_secret_key_here Have good stuff in them.First off to access Cloudwatch we need premissions, so setup an IAM user with the CloudWatchReadOnlyAccess policy. I have only spent a little time glancing at these two books and both of them If you want to learn more about prometheus, you might check outĪnother option, which I have only glanced at so far, is (The following includes affiliate links.) Reading correctly) should be the same, but it is, at least for us, pretty slow. Terms of GetMetricStatistics instead of GetMetricData. Make it fire, but I intend to experiment and bounce ideas off coworkers.Īs a side note I think it’s important to mention that the officialĬloudwatch-exporter has some performance issues due to being implemented in I’m not thrilled with the above, since a huge spike in inbound messages could Here’s a sample of the exported metrics above: aws_sqs_approximate_age_of_oldest_message_maximum) > 0 I looked over the list and our notes from a meeting on how we should monitor SQSĪnd came up with the following configuration for cloudwatch-exporter:Īws_metric_name: ApproximateAgeOfOldestMessageĪws_metric_name: NumberOfMessagesReceivedĪws_metric_name: ApproximateNumberOfMessagesVisible The first AWS service I wanted to add monitoring on is SQS SQS is AWS’ queue This is a little abstract, but I’ll explain it more as we go. $0.01/1,000 metrics requested using GetMetricData First off, a quickĭoing a bunch of GetMetricData requests, and these requests end up querying some So that teams can monitor and alert on their infrastructure. I am writing up a bunch of initial configuration for our cloudwatch-exporter Tell, exposes all the various bits we could ever want. The most part, cloudwatch-exporter works perfectly well and, as far as I can If you use AWS and want to monitor your infrastructure, you probably are going
#Cloudwatch prometheus exporter how to
Today I spent a few hours figuring out how to integrate Prometheus with AWS.
