Skip to content
BleemeoBleemeo

PostgreSQL

Auto-Detection
Built-in Metrics
Logs
Tutorial availableMonitoring PostgreSQL with Bleemeo
Read the tutorial

PostgreSQL is a powerful open-source relational database known for its reliability and feature set.

Glouton detects PostgreSQL by its process and listening port (default: 5432).

To enable metrics gathering, credentials are required. Glouton finds them automatically if PostgreSQL is running in a Docker container with username and password set through the environment variables POSTGRES_USER (defaults to postgres) and POSTGRES_PASSWORD.

By default, only aggregate metrics are gathered. To monitor specific databases, add them to the detailed_items setting.

When using Docker, you can set the databases to monitor and credentials via labels:

Terminal window
docker run --label glouton.detailed_items="bleemeo,postgres" --label glouton.username="USERNAME" --label glouton.password="PASSWORD" [...]

If auto-detected parameters are incorrect, or you want to monitor specific databases, override them manually:

Terminal window
sudo tee /etc/glouton/conf.d/99-postgresql.conf > /dev/null << 'EOF'
service:
# For a PostgreSQL running outside a container
- type: "postgresql"
username: "USERNAME"
password: "PASSWORD"
address: "127.0.0.1"
port: 5432
# For an additional PostgreSQL running outside a container
- type: "postgresql"
instance: "NAME_ASSOCIATED_WITH_YOUR_ADDITIONAL_SERVICE"
username: "USERNAME"
password: "PASSWORD"
address: "127.0.0.1"
port: 5433
# For a PostgreSQL running in a Docker container
- type: "postgresql"
instance: "CONTAINER_NAME"
username: "USERNAME"
password: "PASSWORD"
address: "172.17.0.2"
port: 5432
# Monitor the databases called "bleemeo" and "postgres"
detailed_items:
- bleemeo
- postgres
EOF

Glouton automatically detects configuration changes.

MetricDescription
service_statusStatus of PostgreSQL
postgresql_blk_read_utilizationPostgreSQL data file block read utilization
postgresql_blk_read_utilization_sumSum of PostgreSQL data file block read utilization
postgresql_blk_write_utilizationPostgreSQL data file block write utilization
postgresql_blk_write_utilization_sumSum of PostgreSQL data file block write utilization
postgresql_blks_hit_sumNumber of blocks read from PostgreSQL cache per second
postgresql_blks_read_sumNumber of blocks read from disk per second
postgresql_commit_sumNumber of commits per second
postgresql_rollback_sumNumber of rollbacks per second
postgresql_temp_bytes_sumTemporary file write throughput in bytes per second
postgresql_temp_files_sumNumber of temporary files created per second
postgresql_tup_deleted_sumNumber of rows deleted per second
postgresql_tup_fetched_sumNumber of rows fetched per second
postgresql_tup_inserted_sumNumber of rows inserted per second
postgresql_tup_returned_sumNumber of rows returned per second
postgresql_tup_updated_sumNumber of rows updated per second

Except for service_status, all metrics also exist without the _sum suffix when detailed_items is configured. For example, postgresql_commit with the item mycontainer_mydb corresponds to the number of commits per second on the database mydb running in the container mycontainer.

Glouton collects PostgreSQL logs for analysis in Bleemeo.