Skip to content

BruceLEO1969/sqs-exporter

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AWS SQS Prometheus Exporter

A Prometheus metrics exporter for AWS SQS queues

A few words of Thanks: Most of the code in this repo is borrowed from candeemis/sqs-prometheus-exporter with bundle of thanks and love 🙏 ❤️. I didn't submit this as a pull request to the original repository, since I switch code only to meet my need.

Metrics

Metric Labels Description
sqs_messages_visible Queue Name Number of messages available
sqs_messages_delayed Queue Name Number of messages delayed
sqs_messages_not_visible Queue Name Number of messages in flight

For more information see the AWS SQS Documentation

Configuration

Credentials to AWS are provided in the following order:

  • Environment variables (AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY)
  • Shared credentials file (~/.aws/credentials)
  • IAM role for Amazon EC2

For more information see the AWS SDK Documentation

AWS IAM permissions

The app needs sqs list and read access to the sqs policies

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "VisualEditor0",
            "Effect": "Allow",
            "Action": [
                "sqs:ListQueues",
                "sqs:GetQueueUrl",
                "sqs:ListDeadLetterSourceQueues",
                "sqs:ReceiveMessage",
                "sqs:GetQueueAttributes",
                "sqs:ListQueueTags"
            ],
            "Resource": "*"
        }
    ]
}

Environment Variables

Variable Default Value Description
PORT 9434 The port for metrics server
ENDPOINT metrics The metrics endpoint

Running

docker run -d -p 9434:9434 bruceleo1969/sqs-exporter

You can provide the AWS credentials as environment variables depending upon your security rules configured in AWS;

docker run -d -p 9434:9434 -e AWS_ACCESS_KEY_ID=<access_key> -e AWS_SECRET_ACCESS_KEY=<secret_key> -e AWS_REGION=<region> bruceleo1969/sqs-exporter

About

A Prometheus metrics exporter for AWS SQS queues

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 93.2%
  • Dockerfile 6.8%