Categorygithub.com/1and1/pg-exporter
modulepackage
0.3.1
Repository: https://github.com/1and1/pg-exporter.git
Documentation: pkg.go.dev

# README

PostgreSQL Server Exporter

Prometheus exporter for PostgreSQL server metrics.

Supported version:

  • PostgreSQL >= 9.6

Project state

This project is in early beta. There is missing documentation, things may still change and the default scrapers are not final, and could change at any time.

Building and running

Build

make

Running

export PGHOST="<host>"
export PGUSER="<user>"
# ....
./bin/pg_exporter <flags>

Connection URL

pg_exporter supports libpq parsable connection strings and environments variables. If you want to use a connection string, it could be provided via the DATA_SOURCE_NAME variable

Collector Flags

NamePostgreSQL versionDescription
collect.include.databaseallDatabase to include in the collection. If defined only the given databases are scraped. Can be defined multiple times
collect.exclude.databaseallDatabase to exclude from the collection. Only used if collect.include.database is not given. Can be defined multiple times
collect.infoallCollect postgresql information
collect.pg_stat_activityallCollect from pg_stat_activity
collect.pg_stat_activity.with_usernameallInclude username in session statistics
collect.pg_stat_activity.with_appnameallInclude application name in session statistics
collect.pg_stat_activity.with_clientaddrallInclude application name in session statistics
collect.pg_stat_activity.with_stateallInclude session state in session statistics
collect.pg_stat_activity.with_wait_typeallInclude wait_event_type in session statistics
collect.pg_stat_activity.with_backend_type>= 11Include backend_type in session statistics
collect.pg_stat_user_tablesallCollect from pg_stat_user_tables
collect.pg_settingsallCollect from pg_settings
collect.pg_locksallCollect from pg_locks
collect.pg_stat_bgwriterallCollect from pg_stat_bgwriter
collect.pg_stat_databaseallCollect from pg_stat_database
collect.pg_stat_database_conflictsallCollect from pg_stat_database_conflicts
collect.pg_stat_archiverallCollect from pg_stat_statements
collect.pg_stat_statementsallCollect from pg_stat_archiver
collect.pg_stat_replicationallCollect from pg_stat_replication
collect.pg_prepared_xactsallCollect from pg_prepared_xacts
collect.pg_statio_user_tablesallCollect from pg_statio_user_tables

General Flags

NameDescription
log.levelLogging verbosity (default: info)
web.listen-addressAddress to listen on for web interface and telemetry. (default: :9135)
web.telemetry-pathPath under which to expose metrics. (default: /metrics)
versionPrint the version information.

# Packages

No description provided by the author
No description provided by the author