A CLI tool that scrapes AWS Fargate tasks to find Prometheus targets.
Switch branches/tags
Nothing to show
Clone or download
Latest commit 6c94e53 Oct 30, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.bumpversion.cfg chore: bump version 0.0.1 → 0.0.2 Mar 24, 2018
.gitignore chore: update gitignore Mar 24, 2018
LICENSE chore: initial commit Mar 24, 2018
README.md doc: s/METRIC/METRICS Jul 18, 2018
fargate_scraper.py chore: sort imports May 19, 2018
setup.cfg chore: add flake8{,-quotes} and isort May 19, 2018
setup.py chore(build): drop pipenv Oct 30, 2018

README.md

Fargate Scraper

A CLI tool that scrapes Fargate tasks to find Prometheus targets.

Installation

pip install fargate-scraper

Usage

Give the script the name of the ECS cluster you want to scrape and the location of where it should output the results. It will automatically pick up credentials from its environment. See boto3 for details.

fargate-scraper --cluster-name my-cluster output.json

Then point your prometheus config at that file.

scrape_configs:
  - job_name: prometheus
    metrics_path: "/metrics"
    file_sd_configs:
      - files:
          - output.json
        refresh_interval: 10m

Prometheus will automatically pick up changes to the file.

The script will pick up any Fargate containers that have a METRICS_PORT env var defined.

License

fargate_scraper is licensed under Apache 2.0. Please see LICENSE for licensing details.