Skip to content

Commit

Permalink
Merge pull request #2 from jmriebold/feat/documentation-improvements
Browse files Browse the repository at this point in the history
feat: Improves documentation, removes test queues from docker-compose
  • Loading branch information
jmriebold authored Aug 20, 2020
2 parents b0caa5a + 8763a11 commit 5dfba4d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
22 changes: 16 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,39 @@
# SQS Prometheus Exporter

A simple, lightweight Prometheus metrics exporter for AWS's Simple Queue Service, written in Go.
A simple, lightweight Prometheus metrics exporter for [AWS's Simple Queue Service](https://aws.amazon.com/sqs/), written in Go. Potential use cases are monitoring SQS queues or scaling off SQS queues (e.g. with a [Kubernetes HPA](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/)).

## Use

The SQS Prometheus Exporter can be run using the Docker image with either the docker-compose file or the Helm chart.
The SQS Prometheus Exporter can be run using the [Docker image](https://hub.docker.com/repository/docker/jmriebold/sqs-prometheus-exporter) with either the [docker-compose file](docker-compose.yml) or the [Helm chart](chart).

### Configuration

#### Authentication
#### AWS

In order to authenticate with AWS, the SQS Prometheus Exporter will need AWS credentials either in environment variables (i.e. `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, and `AWS_REGION`), or in the form of a creds file mounted into the container. For more information on authenticating with AWS, see the [official documentation](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-envvars.html).

The user or role that the service will be using to monitor the SQS queues will need the permissions contained in AWS' `AmazonSQSReadOnlyAccess` policy.

#### Application

To set the queues scraped by the Exporter, set the `SQS_QUEUE_URLS` environment variable to a comma-separated list of the SQS queue URLs. For example: `SQS_QUEUE_URLS=https://sqs.[region].amazonaws.com/[account-id]/[queue-name-1],https://sqs.[region].amazonaws.com/[account-id]/[queue-name-2]`

By default the application will scrape queue metrics every 30 seconds. To change this interval, set the `SQS_MONITOR_INTERVAL_SECONDS` environment variable.

### Metrics Exported
### Metrics

The SQS Prometheus Exporter exports the following metrics:
The SQS Prometheus Exporter serves the following metrics:

* `sqs_approximatenumberofmessages`
* `sqs_approximatenumberofmessagesdelayed`
* `sqs_approximatenumberofmessagesnotvisible`

Each has a `queue` label, which will be populated with the name of each queue.
Each has a `queue` label, which will be populated with the queue name and metric value.

### Dependencies

SQS Prometheus Exporter uses the following Go packages:

* [aws-sdk-go](https://github.com/aws/aws-sdk-go) for monitoring the queues themselves
* [prometheus/client_golang](https://github.com/prometheus/client_golang) for metrics
* [zerolog](https://github.com/rs/zerolog) for logging
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ services:
- AWS_SECRET_ACCESS_KEY
- AWS_REGION
- SQS_MONITOR_INTERVAL_SECONDS=30
- SQS_QUEUE_URLS=https://sqs.us-west-2.amazonaws.com/780213378361/gravity-qa-publisher-incoming-production,https://sqs.us-west-2.amazonaws.com/780213378361/nebula-incoming-urls-high,https://sqs.us-west-2.amazonaws.com/780213378361/nebula-incoming-urls-low,https://sqs.us-west-2.amazonaws.com/780213378361/nebula-incoming-urls-normal,https://sqs.us-west-2.amazonaws.com/780213378361/oversight-feature-processor-prod,https://sqs.us-west-2.amazonaws.com/780213378361/oversight-rts-processor-prod,https://sqs.us-west-2.amazonaws.com/780213378361/site-pipeline-processor-input-prod,https://sqs.us-west-2.amazonaws.com/780213378361/vic-mgmt-processor-prod
- SQS_QUEUE_URLS=https://sqs.[region].amazonaws.com/[account-id]/[queue-name-1],https://sqs.[region].amazonaws.com/[account-id]/[queue-name-2]
ports:
- 80:8080

0 comments on commit 5dfba4d

Please sign in to comment.