A simple, lightweight Prometheus metrics exporter for AWS's Simple Queue Service, written in Go. Potential use cases are monitoring SQS queues or scaling off SQS queues (e.g. with a Kubernetes HPA).
helm repo add jmriebold https://jmriebold.github.io/charts
helm install release-name --set sqs.region=[region-name] \
--set sqs.queueUrls[0]=https://sqs.[region].amazonaws.com/[account-id]/[queue-name-1] \
jmriebold/sqs-prometheus-exporter
In order to authenticate with AWS, the SQS Prometheus Exporter will need AWS credentials either in environment variables (i.e. AWS_ACCESS_KEY_ID
and AWS_SECRET_ACCESS_KEY
), a creds file mounted into the container, or a role to assume via IRSA or kiam/kube2iam. For more information on authenticating with AWS, see the official documentation.
The user or role that the service will be using to monitor the SQS queues will need the permissions contained in AWS' AmazonSQSReadOnlyAccess
policy.
Name | Description | Default |
---|---|---|
sqs.region |
AWS region name | "us-west-2" |
sqs.queueUrls |
List of AWS SQS queue URLs | [] |
sqs.monitorIntervalSeconds |
Interval for polling SQS | 30 |
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 queue name and metric value.
To use IRSA for granting SQS Prometheus Exporter access to SQS:
helm install release-name \
--set sqs.region=[region-name] \
--set sqs.queueUrls[0]=https://sqs.[region].amazonaws.com/[account-id]/[queue-name-1] \
--set serviceAccount.create=true \
--set serviceAccount.annotations."eks\.amazonaws\.com/role-arn"=[role-arn] \
jmriebold/sqs-prometheus-exporter
To use Kiam/Kube2Iam for granting SQS Prometheus Exporter access to SQS:
helm install release-name \
--set sqs.region=[region-name] \
--set sqs.queueUrls[0]=https://sqs.[region].amazonaws.com/[account-id]/[queue-name-1] \
--set podAnnotations."iam\.amazonaws\.com/role"=[role-name] \
jmriebold/sqs-prometheus-exporter
To use AWS environment variables for granting SQS Prometheus Exporter access to SQS:
helm install release-name \
--set sqs.region=[region-name] \
--set sqs.queueUrls[0]=https://sqs.[region].amazonaws.com/[account-id]/[queue-name-1] \
--set extraEnv.AWS_ACCESS_KEY_ID=[aws-access-key] \
--set extraEnv.AWS_SECRET_ACCESS_KEY=[aws-secret-access-key] \
jmriebold/sqs-prometheus-exporter