ikscream / go-prometheus-exporter-aws-sqs

A simple, lightweight Prometheus metrics exporter for AWS's Simple Queue Service, written in Go.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SQS Prometheus Exporter

build Artifact Hub

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).

Use

The SQS Prometheus Exporter can be run using the Docker image with either the docker-compose file or the Helm chart.

Configuration

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), 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.

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

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.

Dependencies

SQS Prometheus Exporter uses the following Go packages:

About

A simple, lightweight Prometheus metrics exporter for AWS's Simple Queue Service, written in Go.

License:MIT License


Languages

Language:Go 72.4%Language:Mustache 20.5%Language:Dockerfile 7.1%