Skip to main content

Script for monitoring PostgreSQL databases with InfluxDB

Project description

pgflux

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

Screenshots

It enables Grafana visualisations as seen in the screenshots below:

https://raw.githubusercontent.com/post-luxembourg/pgflux/v1.0.1/docs/_images/grafana-dashboard-01.png https://raw.githubusercontent.com/post-luxembourg/pgflux/v1.0.1/docs/_images/grafana-dashboard-02.png https://raw.githubusercontent.com/post-luxembourg/pgflux/v1.0.1/docs/_images/grafana-dashboard-03.png

Installation

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.

Usage

See https://post-luxembourg.github.io/pgflux/usage.html

Development & Extending

For detailed instructions, see https://post-luxembourg.github.io/pgflux/development.html

NOTE

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

Commands

  • 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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file pgflux-1.1.0.tar.gz.

File metadata

  • Download URL: pgflux-1.1.0.tar.gz
  • Upload date:
  • Size: 14.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.7.13

File hashes

Hashes for pgflux-1.1.0.tar.gz
Algorithm Hash digest
SHA256 8d099a8fdca1ecb8d7aaaf193dc48bb9d832fd2c0bd908bef251d8a298e812dd
MD5 e5adf34e835e31ca1df1f628f363c287
BLAKE2b-256 0648b9409efbbd5c27acc36382db5af9abdf91e77445d58e0bcdd97d18f7cc85

See more details on using hashes here.

File details

Details for the file pgflux-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: pgflux-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 20.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.7.13

File hashes

Hashes for pgflux-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a8865c2f52ad5bff4cad748e6b76256e9336a0ebb9fb81628e7b1b4ed2d0b06e
MD5 498650f4c5bcdcb35005ad4796763413
BLAKE2b-256 a2ee5c60e2da8779ab27a155a843874feb63c3b4a5ef77eadac8c45572d468f5

See more details on using hashes here.

Supported by

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