Skip to content
This repository has been archived by the owner on May 5, 2018. It is now read-only.

TheKevJames/postgres-stats-publisher

Repository files navigation

Postgres Stats Publisher

Publishes statistics from PostgreSQL's pg_stat tables. Supports Postgres → Librato and Postgres → Carbon

Originally forked from postgres-librato, this project's name was changed since it now supports endpoints other than librato. Full credit goes to Torsten Becker for creating the original project.

Features

Compatible with PostgreSQL v9.1 and greater.

Exposes the following stats:

  • postgres.pg_stat.backends — gauge
  • 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.db_size - guage
  • 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.locks - gauge
  • 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

1. Install the dependencies:

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

About

Publish postgres stats to Librato or Carbon

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published

Languages