Publishes statistics from PostgreSQL's pg_stat tables to Librato.
Compatible with PostgreSQL 9.1, 9.2, and 9.3.
Exposes the following stats:
postgres.pg_stat.backends_active
— gaugepostgres.pg_stat.backends_idle_in_transaction
— gaugepostgres.pg_stat.backends_idle
— gaugepostgres.pg_stat.backends_null
— gaugepostgres.pg_stat.backends_waiting
— gaugepostgres.pg_stat.block_read_time
— counterpostgres.pg_stat.cache_hits
— gaugepostgres.pg_stat.disk_blocks_cache_hit
— counterpostgres.pg_stat.disk_blocks_read
— counterpostgres.pg_stat.index_hits
— gaugepostgres.pg_stat.index_scans
— counterpostgres.pg_stat.max_query_time
— gaugepostgres.pg_stat.mean_query_time
— gaugepostgres.pg_stat.median_query_time
— gaugepostgres.pg_stat.rows_deleted
— counterpostgres.pg_stat.rows_fetched
— counterpostgres.pg_stat.rows_inserted
— counterpostgres.pg_stat.rows_returned
— counterpostgres.pg_stat.rows_updated
— counterpostgres.pg_stat.sequential_scans
— counterpostgres.pg_stat.temp_file_bytes
— counterpostgres.pg_stat.transactions_committed
— counterpostgres.pg_stat.transactions_rolled_back
— counter
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