Skip to main content

The SAU Exporter is a Python-based application designed to collect and expose AWS EC2 and EBS volume metrics for monitoring and observability. It utilizes the Prometheus client library to provide an HTTP endpoint for scraping metrics.

Project description

SAU Exporter

Overview

The SAU Exporter is a Python-based application designed to collect and expose AWS EC2 and EBS volume metrics for monitoring and observability. It utilizes the Prometheus client library to provide an HTTP endpoint for scraping metrics.

Features

  • EC2 Metrics: Collects information about stopped EC2 instances in different AWS regions.
  • EBS Volume Metrics: Retrieves data on unattached/errored EBS volumes, including volume state, type, size, and region.
  • Prometheus Integration: Exposes metrics in the Prometheus format, making it compatible with Prometheus monitoring systems.

Getting Started

Installing via pip

Offers support for python>=3.8

pip install sau

Using pip package after installation

python3 -m sau -c /path/to/config.yaml

Installing using docker

The docker repository is available at link. You will need the following:

  • config file: see section
  • AWS Credentials: It would be easier to put the creds in a env file and reference the file when running container. Example .env file can be seen below:
AWS_ACCESS_KEY_ID=129QJDNC2OQD09N
AWS_SECRET_ACCESS_KEY=9KXXXXXXXXX
AWS_REGION=eu-central-1

To run the container, use the example command below:

docker run -ti --env-file .env -v /path/to/config.yaml:/sau/config.yaml ugwuanyi/sau:latest -c /sau/config.yaml

Prerequisites:

  • Python 3.8+ installed on your system.
  • Ensure the required Python libraries are installed by running the following command.
pip install -r requirements.txt

Configuration:

Create a YAML configuration file with the necessary settings.

Configuration Options

  • Regions: Specify the AWS regions for which you want to collect metrics.
  • Exporter Port: Define the port on which the exporter will expose metrics (default: 9000).
  • Logging Configuration: Customize logging settings, such as log file directory and retention. See example below.
# list of regions to scrape: REQUIRED
regions:
  - eu-central-1
  - eu-west-1

# exporter port. Defaults to 9000
exporter_port: 9000

# Logging configuration
logging:
  # Number of log files to retain after log rotation
  retention: 7
  # log directory. defaults to current working directory
  directory: "."
  # log level (debug, info, warn, error). Defaults to info
  level: info

Running the Exporter:

Execute the exporter by providing the path to the configuration file:

python3 sau_exporter.py -c /path/to/your/config.yaml

Metrics Endpoint:

Once the exporter is running, metrics can be accessed at http://localhost:<exporter_port>/.

Customization

Feel free to extend or customize the exporter to meet your specific requirements. You can modify the provided code or add additional collectors to gather more AWS resource metrics.

License

This project is licensed under the MIT License. Feel free to use, modify, and distribute it according to the terms of the license.

Author

Created by Emeka Ugwuanyi. For questions or feedback, please contact me.

Happy monitoring!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sau-test-0.0.5.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

sau_test-0.0.5-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file sau-test-0.0.5.tar.gz.

File metadata

  • Download URL: sau-test-0.0.5.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for sau-test-0.0.5.tar.gz
Algorithm Hash digest
SHA256 a2e0590ab9d985657cc96733d5a97ad10f89819cb935a910d4420a01ffa712b7
MD5 7a2d9aa430543b9ed5779d566d6a4cf0
BLAKE2b-256 eb8348321eb8add2593577c26f4d81a58bfda694130fc7259832d3557b2df0bb

See more details on using hashes here.

File details

Details for the file sau_test-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: sau_test-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 8.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for sau_test-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 afca716b4ea5d47f1004087e9a793b79416282453583bee7f82acb58c0f94a48
MD5 c9e0bd6db044c62fd33ae47f462c071f
BLAKE2b-256 4ccda93c3615f257e0109ed37b07068d82f10e83155d3be5d1755d6b7c518db4

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page