PostgreSQL Metrics with InstrumentalD
The best way to get PostgreSQL metrics into Instrumental is with InstrumentalD, the fast and reliable server agent created by the Instrumental team. By using InstrumentalD to collect PostgreSQL metrics, you'll get premade PostgreSQL graphs and unlock the full power of our Query Language.
- Quick Start
- Configuring InstrumentalD
- PostgreSQL Metrics Collected
- How many metrics can I expect from InstrumentalD?
- Dashboard
Quick Start
Check out our Installation Instructions for more details. Otherwise, here's the bare minimum to get up and running.
brew install instrumental/instrumentald/instrumentald echo 'postgresql = ["postgres://postgres@localhost?sslmode=disable"]' >> instrumentald.toml instrumentald -c instrumentald.toml -k PROJECT_TOKEN
curl https://packagecloud.io/install/repositories/expectedbehavior/instrumental/script.deb.sh | sudo bash sudo apt-get install instrumentald echo 'project_token = "PROJECT_TOKEN"' | sudo tee /etc/instrumentald.toml echo 'postgresql = ["postgres://postgres@localhost?sslmode=disable"]' | sudo tee -a /etc/instrumentald.toml sudo systemctl restart instrumentald
curl https://packagecloud.io/install/repositories/expectedbehavior/instrumental/script.rpm.sh | sudo bash sudo yum install instrumentald echo 'project_token = "PROJECT_TOKEN"' | sudo tee /etc/instrumentald.toml echo 'postgresql = ["postgres://postgres@localhost?sslmode=disable"]' | sudo tee -a /etc/instrumentald.toml sudo service instrumentald restart
Configuring InstrumentalD
InstrumentalD will collect the metrics below from as many PostgreSQL servers as configured. Here's a basic example of the PostgreSQL config:
postgresql = ["postgres://postgres@localhost?sslmode=disable"]
Everything you need to know about configuring InstrumentalD, including more information about PostgreSQL config, can be found in the InstrumentalD Configuration docs.
Metrics Collected
All PostgreSQL metrics collected by InstrumentalD follow this pattern:
postgres.<host from connection string>.<database name>.<metric>
blk_read_time |
Time spent reading data file blocks by backends in this database, in milliseconds |
---|---|
blk_write_time |
Time spent writing data file blocks by backends in this database, in milliseconds |
blks_read |
Number of disk blocks read in this database |
deadlocks |
Number of deadlocks detected in this database |
numbackends |
Number of clients (backends) currently connected to this database. This is the only column in this view that returns a value reflecting current state; all other columns return the accumulated values since the last reset |
temp_bytes |
Total amount of data written to temporary files by queries in this database. All temporary files are counted, regardless of why the temporary file was created, and regardless of the log_temp_files setting |
tup_deleted |
Number of rows deleted by queries in this database |
tup_fetched |
Number of rows fetched by queries in this database |
tup_inserted |
Number of rows inserted by queries in this database |
tup_returned |
Number of rows returned by queries in this database |
tup_updated |
Number of rows updated by queries in this database |
xact_commit |
Number of transactions in this database that have been committed |
xact_rollback |
Number of transactions in this database that have been rolled back |
checkpoint_sync_time |
Total amount of time that has been spent in the portion of checkpoint processing where files are synchronized to disk, in milliseconds |
---|---|
checkpoint_write_time |
Total amount of time that has been spent in the portion of checkpoint processing where files are written to disk, in milliseconds |
How many metrics can I expect from InstrumentalD?
InstrumentalD will collect 15 metrics per PostgreSQL database configured.
Dashboard
Here are the graphs included in our PostgreSQL Dashboard. It's a great way to get started visualizing these metrics.