<commit_before>CloudWatch Exporter
=====

A Prometheus exporter for [Amazon CloudWatch](http://aws.amazon.com/cloudwatch/).

## Alternatives

For ECS workloads, there is also an [ECS exporter](https://github.com/prometheus-community/ecs_exporter).

For a different approach to CloudWatch metrics, with automatic discovery, consider [Yet Another CloudWatch Exporter (YACE)](https://github.com/nerdswords/yet-another-cloudwatch-exporter).

## Building and running

Cloudwatch Exporter requires at least Java 8.

`mvn package` to build.

`java -jar target/cloudwatch_exporter-*-SNAPSHOT-jar-with-dependencies.jar 9106 example.yml` to run.

The most recent pre-built JAR can be found at http://search.maven.org/#search%7Cga%7C1%7Ca%3A%22cloudwatch_exporter%22

## Credentials and permissions

The CloudWatch Exporter uses the
[AWS Java SDK](http://docs.aws.amazon.com/AWSSdkDocsJava/latest/DeveloperGuide/welcome.html),
which offers [a variety of ways to provide credentials](http://docs.aws.amazon.com/AWSSdkDocsJava/latest/DeveloperGuide/credentials.html).
This includes the `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` environment
variables.

The `cloudwatch:ListMetrics` and `cloudwatch:GetMetricStatistics` IAM permissions are required.
The `tag:GetResources` IAM permission is also required to use the `aws_tag_select` feature.

## Configuration
The configuration is in YAML.

An example with common options and `aws_dimension_select`:<commit_msg>Changed java requirment in README<commit_after>CloudWatch Exporter
=====

A Prometheus exporter for [Amazon CloudWatch](http://aws.amazon.com/cloudwatch/).

## Alternatives

For ECS workloads, there is also an [ECS exporter](https://github.com/prometheus-community/ecs_exporter).

For a different approach to CloudWatch metrics, with automatic discovery, consider [Yet Another CloudWatch Exporter (YACE)](https://github.com/nerdswords/yet-another-cloudwatch-exporter).

## Building and running

Cloudwatch Exporter requires at least Java 11.

`mvn package` to build.

`java -jar target/cloudwatch_exporter-*-SNAPSHOT-jar-with-dependencies.jar 9106 example.yml` to run.

The most recent pre-built JAR can be found at http://search.maven.org/#search%7Cga%7C1%7Ca%3A%22cloudwatch_exporter%22

## Credentials and permissions

The CloudWatch Exporter uses the
[AWS Java SDK](http://docs.aws.amazon.com/AWSSdkDocsJava/latest/DeveloperGuide/welcome.html),
which offers [a variety of ways to provide credentials](http://docs.aws.amazon.com/AWSSdkDocsJava/latest/DeveloperGuide/credentials.html).
This includes the `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` environment
variables.

The `cloudwatch:ListMetrics` and `cloudwatch:GetMetricStatistics` IAM permissions are required.
The `tag:GetResources` IAM permission is also required to use the `aws_tag_select` feature.

## Configuration
The configuration is in YAML.

An example with common options and `aws_dimension_select`:
{'fraction_non_alphanumeric': 0.09846153846153846, 'fraction_numerical': 0.009914529914529915, 'mean_word_length': 5.884705882352941, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '431960', 'n_tokens_mistral': 939, 'n_tokens_neox': 877, 'n_words': 255}