Publishes statistics from PostgreSQL's pg_stat tables to Librato.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
LICENSE
README.md
publish.py
requirements.txt
sample-config.json

README.md

Postgres → Librato

Publishes statistics from PostgreSQL's pg_stat tables to Librato.

Features

Compatible with PostgreSQL 9.1, 9.2, and 9.3.

Exposes the following stats:

  • postgres.pg_stat.backends_active — gauge
  • postgres.pg_stat.backends_idle_in_transaction — gauge
  • postgres.pg_stat.backends_idle — gauge
  • postgres.pg_stat.backends_null — gauge
  • postgres.pg_stat.backends_waiting — gauge
  • postgres.pg_stat.block_read_time — counter
  • postgres.pg_stat.cache_hits — gauge
  • postgres.pg_stat.disk_blocks_cache_hit — counter
  • postgres.pg_stat.disk_blocks_read — counter
  • postgres.pg_stat.index_hits — gauge
  • postgres.pg_stat.index_scans — counter
  • postgres.pg_stat.max_query_time — gauge
  • postgres.pg_stat.mean_query_time — gauge
  • postgres.pg_stat.median_query_time — gauge
  • postgres.pg_stat.rows_deleted — counter
  • postgres.pg_stat.rows_fetched — counter
  • postgres.pg_stat.rows_inserted — counter
  • postgres.pg_stat.rows_returned — counter
  • postgres.pg_stat.rows_updated — counter
  • postgres.pg_stat.sequential_scans — counter
  • postgres.pg_stat.temp_file_bytes — counter
  • postgres.pg_stat.transactions_committed — counter
  • postgres.pg_stat.transactions_rolled_back — counter

Setup (Ubuntu)

1. Install all the dependencies (psycopg2, librato-metrics):

$ sudo apt-get -q -y install python-pip python-psycopg2
$ sudo pip install -r requirements.txt

2. Create a config file based on sample-config.json.

3. Setup a upstart script (or something similar)

start on runlevel [2345]
stop on runlevel [016]

setuid app
setgid app

# TODO: Edit these paths:
exec python .../publish.py .../config.json
respawn

Related Work