Skip to main content

Script for monitoring PostgreSQL databases with InfluxDB

Project description


pgflux is a Python utility to send PostgreSQL metrics to InfluxDB. The drivers when developing this tool were:

  • Make it easy to extend: Authoring new queries should only require PostgreSQL knowledge to allow non-devs to easily add/fix/modify the collected metrics. pgflux does not require you to know Python, InfluxDB nor Grafana to work on the provided SQL queries.

  • Be independently runnable: pgflux should be runnable without first setting up a hugely complex dev-environment. All that is needed is a Python environment and a PostgreSQL server (a Dockerfile for testing is supplied for the latter).


It enables Grafana visualisations as seen in the screenshots below:


The project can be installed directly via pip:

python3 -m venv /path/to/virtual-env
/path/to/virtual-env/bin/pip install pgflux

The use of a virtual environment is optional, but recommended.



Development & Extending

For detailed instructions, see


This project uses fabric as task runner (see To install it use either pipx install fabric (recommended) or, if you don’t have pipx: pip install --user fabric.


  • Listing all available development tasks:

    fab -l
  • To set up or refresh the development environment:

    fab develop
  • Run PostgreSQL, InfluxDB & Grafana containers (requires docker-compose):

    fab run-dev-containers
  • Run the tests:

    fab test

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

pgflux-1.1.0.tar.gz (14.9 kB view hashes)

Uploaded Source

Built Distribution

pgflux-1.1.0-py3-none-any.whl (20.3 kB view hashes)

Uploaded Python 3

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