https://github.com/1and1/pg-exporter
Improved prometheus exporter for PostgreSQL
https://github.com/1and1/pg-exporter
go golang hacktoberfest2020 postgresql prometheus prometheus-exporter
Last synced: 8 months ago
JSON representation
Improved prometheus exporter for PostgreSQL
- Host: GitHub
- URL: https://github.com/1and1/pg-exporter
- Owner: 1and1
- License: mit
- Created: 2020-10-02T10:00:01.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2025-02-10T17:00:08.000Z (over 1 year ago)
- Last Synced: 2025-02-10T17:38:02.661Z (over 1 year ago)
- Topics: go, golang, hacktoberfest2020, postgresql, prometheus, prometheus-exporter
- Language: Go
- Homepage:
- Size: 4.02 MB
- Stars: 6
- Watchers: 6
- Forks: 4
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
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
```shell
make
```
### Running
```shell
export PGHOST=""
export PGUSER=""
# ....
./bin/pg_exporter
```
#### 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
| Name | PostgreSQL version | Description |
|--------------------------------------------|---------------------|------------------------------------------------|
| collect.include.database | all | Database to include in the collection. If defined only the given databases are scraped. Can be defined multiple times |
| collect.exclude.database | all | Database to exclude from the collection. Only used if collect.include.database is not given. Can be defined multiple times |
| collect.info | all | Collect postgresql information |
| collect.pg_stat_activity | all | Collect from pg_stat_activity |
| collect.pg_stat_activity.with_username | all | Include username in session statistics |
| collect.pg_stat_activity.with_appname | all | Include application name in session statistics |
| collect.pg_stat_activity.with_clientaddr | all | Include application name in session statistics |
| collect.pg_stat_activity.with_state | all | Include session state in session statistics |
| collect.pg_stat_activity.with_wait_type | all | Include wait_event_type in session statistics |
| collect.pg_stat_activity.with_backend_type | >= 11 | Include backend_type in session statistics |
| collect.pg_stat_user_tables | all | Collect from pg_stat_user_tables |
| collect.pg_settings | all | Collect from pg_settings |
| collect.pg_locks | all | Collect from pg_locks |
| collect.pg_stat_bgwriter | all | Collect from pg_stat_bgwriter |
| collect.pg_stat_database | all | Collect from pg_stat_database |
| collect.pg_stat_database_conflicts | all | Collect from pg_stat_database_conflicts |
| collect.pg_stat_archiver | all | Collect from pg_stat_statements |
| collect.pg_stat_statements | all | Collect from pg_stat_archiver |
| collect.pg_stat_replication | all | Collect from pg_stat_replication |
| collect.pg_prepared_xacts | all | Collect from pg_prepared_xacts |
| collect.pg_statio_user_tables | all | Collect from pg_statio_user_tables |
| collect.pg_stat_checkpointer | >= 17 | Collect from pg_stat_checkpointer |
### General Flags
| Name | Description |
|---------------------|--------------------------------------------------------------------------|
| log.level | Logging verbosity (default: info) |
| web.listen-address | Address to listen on for web interface and telemetry. (default: `:9135`) |
| web.telemetry-path | Path under which to expose metrics. (default: `/metrics`) |
| version | Print the version information. |