Commit Graph

85 Commits

Author SHA1 Message Date
fhackenberger
3c5ef40e2b
Update README.md (#1038)
Better example for the quick start with prometheus config and avoiding deprecated env variables.

Signed-off-by: fhackenberger <florian@hackenberger.at>
2024-07-06 12:36:52 -04:00
Ben Kochie
68c176b883
Release v0.15.0 (#944)
* [ENHANCEMENT] Add 1kB and 2kB units #915
* [BUGFIX] Add error log when probe collector creation fails #918
* [BUGFIX] Fix test build failures on 32-bit arch #919
* [BUGFIX] Adjust collector to use separate connection per scrape #936

Signed-off-by: SuperQ <superq@gmail.com>
2023-10-27 16:25:39 +02:00
Joe Adams
c06e57db4e
Add changelog for v0.14 (#906)
* Add changelog for v0.14

- Add changelog entries since v0.13.2
- Update README with new options
- Bump version file

Signed-off-by: Joe Adams <github@joeadams.io>

* Add changelog entry for #904

Signed-off-by: Joe Adams <github@joeadams.io>

---------

Signed-off-by: Joe Adams <github@joeadams.io>
2023-09-19 21:27:45 -04:00
David Cook
dbc7b0b229
Fix cross-compilation command in README.md (#903)
Signed-off-by: David Cook <dcook@divviup.org>
2023-09-08 16:08:06 -04:00
Mathis Raguin
ce4ee0507f
Update README to reflect changes made in #828 (#894)
Signed-off-by: Mathis Raguin <mathis.raguin@gitguardian.com>
2023-08-24 09:58:41 +02:00
Ben Kochie
04bb60ce31
Add a multi-target example config (#890)
Add an example Prometheus scrape config, similar to the
blackbox_exporter's example config.

Fixes: https://github.com/prometheus-community/postgres_exporter/issues/888

Signed-off-by: SuperQ <superq@gmail.com>
2023-08-15 13:49:05 +02:00
Ben Kochie
1a4e8993f6
Migrate pg_locks to collector package (#817)
Migrate the `pg_locks_count` query from `main` to the `collector`
package.

Signed-off-by: SuperQ <superq@gmail.com>
2023-06-27 15:59:30 +02:00
SuperQ
db08eee988
Release v0.13.0
BREAKING CHANGES:

Please note, the following features are deprecated and may be removed in a future release:
- `auto-discover-databases`
- `extend.query-path`
- `constantLabels`
- `exclude-databases`
- `include-databases`

This exporter is meant to monitor PostgresSQL servers, not the user data/databases. If
you need a generic SQL report exporter https://github.com/burningalchemist/sql_exporter
is recommended.

* [CHANGE] Adjust log level for collector startup #784
* [CHANGE] Move queries from queries.yaml to collectors #801
* [CHANGE] Deprecate extend queries feature #811
* [CHANGE] Deprecate additional database features #815
* [CHANGE] Convert pg_stat_database to new collector #685
* [ENHANCEMENT] Supports alternate postgres:// prefix in URLs #787
* [BUGFIX] Fix pg_setting different help values #771
* [BUGFIX] Fix column type for pg_replication_slots #777
* [BUGFIX] Fix pg_stat_database collector #809

Signed-off-by: SuperQ <superq@gmail.com>
2023-06-21 15:33:23 +02:00
SuperQ
c71d395bf6
Deprecate additional database features
Now that we have deprecated extended queries we can deprecate related
database features.
* Deprecate flags/functions around auto discover databases.
* Deprecate flags/functions for additional constant labels.

Signed-off-by: SuperQ <superq@gmail.com>
2023-06-19 13:05:57 +02:00
Ben Kochie
7dcf1dc7b6
Deprecate extend queries feature (#811)
Mark the extend queries feature as deprecated in favor of recommending
the sql_exporter.

Signed-off-by: SuperQ <superq@gmail.com>
2023-06-13 17:39:39 +02:00
Joe Adams
a32ef40053
Update README cli flags
These have not been kept up to date.

Signed-off-by: Joe Adams <github@joeadams.io>
2023-03-29 20:13:51 -04:00
SuperQ
6e2f8c332b
Update versions listed in the README
Update the supported versions based on what we actually test in CI.

Signed-off-by: SuperQ <superq@gmail.com>
2023-03-28 23:18:18 +02:00
Ben Kochie
0e4506e3f4
Merge pull request #746 from prometheus-community/bjk/exporter-toolkit-bump
Update exporter-toolkit
2023-01-25 09:31:55 +01:00
SuperQ
fc264d0ab0
Update exporter-toolkit
Update to the latest exporter-toolkit
* Enables multi-listener and systemd socket activation.
* Bump Go to 1.19.
* Remove `PG_EXPORTER_WEB_LISTEN_ADDRESS` env var because this is now a
  repeatable flag.

Signed-off-by: SuperQ <superq@gmail.com>
2023-01-24 17:57:31 +01:00
Khiem Doan
045f24fd63 Add postgres 15 for CI test
Signed-off-by: Khiem Doan <doankhiem.crazy@gmail.com>
2022-12-27 09:07:35 +07:00
Luckz
b10a942f40
Correct additional typo in README.md
Signed-off-by: Luckz <224748+Luckz@users.noreply.github.com>
2022-11-06 16:24:43 +01:00
Luckz
adf8fc1d95
Correct minor typos in README.md
Signed-off-by: Luckz <224748+Luckz@users.noreply.github.com>
2022-08-10 18:20:20 +02:00
Joe Adams
72430f8d2a Update cmd/postgres_exporter/main.go
Signed-off-by: Joe Adams <github@joeadams.io>
2022-07-28 10:21:02 -04:00
Joe Adams
8f8d2208f5 cleanup and README
Signed-off-by: Joe Adams <github@joeadams.io>

Co-authored-by: Ben Kochie <superq@gmail.com>
2022-07-28 10:19:32 -04:00
Austin Godber
d80081e638 Update readme to include Postgres 14 support
It looks like postgres 14.1 was added to CI here:

fcb2535aff

See also: https://github.com/prometheus-community/postgres_exporter/issues/651#issuecomment-1156947591

Signed-off-by: Austin Godber <godber@uberhip.com>
2022-06-15 14:25:13 -07:00
Joe Adams
27d23d02ef
refactor pg_stat_bgwriter metrics into standalone collector
This moves the metrics that are queried from pg_stat_bgwriter into a dedicated collector instead of dynamically generating queries and metrics from a map. It renames some metrics including adding the `_total` suffix on all of the counters to match prometheus standards. This implementation uses QueryRowContext to allow for later addition of context for cancellation. From the Postgres documentation, it states that there is one line per WAL sender process, but it is unclear how to differentiate between them in any meaningful way. When querying the table, there is no column to identify the row, only metrics about bgwriter.

Signed-off-by: Joe Adams <github@joeadams.io>
2022-02-22 21:46:43 -05:00
Joe Adams
8d6d3041b9
Merge pull request #565 from alexmv/patch-1
Remove misplaced and duplicated phrase in README
2022-02-09 22:21:58 -05:00
Joe Adams
99446791e4
Merge pull request #567 from xelatirdan/patch-1
Add error prone SQL in README.md
2022-02-09 22:21:17 -05:00
Joe Adams
c0ca2fd0c9
Merge pull request #590 from juris-greitans/master
#258 Document running as non-superuser on PostgreSQL versions 10 or newer.
2022-01-26 10:07:23 -05:00
Alex
b10a7b7d3b
Clarify default values for CLI flags
Reference here: https://grafana.com/docs/agent/latest/configuration/integrations/postgres-exporter-config/
Also, matches the environment variables section.

Signed-off-by: Alex Ruddick <a.ruddick@numat-tech.com>
2022-01-18 12:18:09 -06:00
juris.greitans
7c76896aa8 Fix issues mentioned in review. Add link to PostgreSQL documentation about pre-defined roles.
Signed-off-by: juris.greitans <juris.greitans@visma.com>
2021-11-29 13:13:14 +02:00
juris.greitans
545c3b7eba #258 Document running as non-superuser on PostgreSQL versions 10 or newer.
Signed-off-by: juris.greitans <juris.greitans@visma.com>
2021-11-17 12:44:59 +02:00
Xela
20aefc2e15 Add some SQL in README.md
Getting the error when adding non-root postgres user for exporter:
```
postgres=# CREATE OR REPLACE FUNCTION get_pg_stat_statements() RETURNS SETOF pg_stat_statements AS
postgres-# $$ SELECT * FROM public.pg_stat_statements; $$
postgres-# LANGUAGE sql
postgres-# VOLATILE
postgres-# SECURITY DEFINER;
ERROR:  type "pg_stat_statements" does not exist
```
Add following sql command for enable pg_stat_statements:
```
CREATE EXTENSION IF NOT EXISTS pg_stat_statements;
```

Signed-off-by: Xela Tirdan <xelatirdan@gmail.com>
2021-09-08 21:35:23 +03:00
Magnus Hagander
d9435b4c80 Fix typos in README
Signed-off-by: Magnus Hagander <magnus@hagander.net>
2021-08-24 13:28:32 +02:00
Alex Vandiver
d9a081d6d9 Remove misplaced and duplicated phrase in README
Signed-off-by: Alex Vandiver <alex@chmrr.net>
2021-08-02 11:43:20 -07:00
Paul van der Linden
bc97291103 basic integration test
Signed-off-by: Paul van der Linden <mail@paultjuh.org>
2021-04-19 15:20:53 +02:00
Pavel Sapezhko
2850ac800a
Add ability to set allow DBs list
Signed-off-by: Pavel Sapezhko <me@weastur.com>
2021-03-11 16:43:13 +03:00
Julien Pivotto
be790e12ff Switch to go-kit log and enable TLS/basic auth
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
2021-03-02 15:31:55 +01:00
Ben Kochie
33e61f3277
Add integration tests
Setup integration test matrix in CircleCI.
* Update README integration testing list.

Signed-off-by: Ben Kochie <superq@gmail.com>
2021-02-28 14:26:51 +01:00
Ben Kochie
b67b69acd3
Update for Prometheus Community
Add standard Prometheus build setup
* CircleCI config
* Makefile
* Go modules
* Golang-CI Lint
* promu config
* Remove /vendor
* Remove mage build
* Update READMEs

https://github.com/prometheus-community/postgres_exporter/issues/478

Signed-off-by: Ben Kochie <superq@gmail.com>
2021-02-23 10:51:33 +01:00
Ajay Bhat
c55a3b3c5b
Fixes (#364) (#387)
Have a custom prefix for each of the default metrics created by postgres_exporter

Co-authored-by: Will Rouesnel <wrouesnel@wrouesnel.com>
2020-12-25 02:36:18 +11:00
Robbie Trencheny
a7538454ed
Add pg_stat_statements view for non-superuser instructions (#398) 2020-08-28 10:03:23 +10:00
Lars Kellogg-Stedman
77d42931d0
update docs with examples of DATA_SOURCE_URI (#378)
this has a minor change to the wording and a couple of examples to demonstrate
the use of DATA_SOURCE_URI.

Closes #113
2020-04-10 01:14:24 +10:00
Vladimir N. Indik
75d542d496 Update "Flags" list in README (#331)
* Update README according --help output

* Update environment variables list in README
2019-11-20 10:19:34 +11:00
sfalkon
deac1c37db fix master database behavior 2019-11-20 10:18:20 +11:00
Benjamin P. Jung
9b13f5ec57 Add support for 'DATA_SOURCE_URI_FILE' envvar.
Closes #326 as is provides a viable solution to use a K8S init container
to fully contruct the PostgreSQL URI and 'hand it over' to the postgres_exporter
process.
2019-11-20 10:17:31 +11:00
Will Rouesnel
c2866fd2e2
Fix README.md. 2019-11-01 01:04:08 +11:00
Marcos A L M Macedo
27d5c9926d Add SQL for grant connect (#303)
To resolve the error below, it was necessary to add a new grant to the database postgres.

Error: 'pq: permission denied for database \ "postgres \"'
2019-10-30 14:58:17 +11:00
Alexis Sellier
1ab8d2bbc8 Discover only databases that are not templates and allow connections (#297)
* Discover only databases that are not templates and allow connections

* Update readme
2019-08-12 11:40:58 +10:00
Alexis Sellier
c768e64548 Add --exclude-databases option (#298)
* Add exclude-databases option
* Update readme to explain --exclude-databases
* Add comments to ExcludeDatabases function and unexport Contains function
2019-08-12 11:25:01 +10:00
Sakis
1c14eb964a README: SQL that supports re-execution
Make the SQL work in automated deployments where it will be repeated many times.
2019-07-12 10:26:07 +10:00
Will Rouesnel
97554928e6
Update README.md 2019-07-03 22:37:58 +10:00
Arno Geurts
4d96104c10 Add documentation for auto-discover-databases 2019-07-03 22:17:15 +10:00
Asher Foa
f9bb147ee8 Add badge for docker pulls. 2019-07-01 08:43:24 +10:00
Michael Kaye
b12adc11e4 Update README.md
Allow non-superuser commands to be re-run without (some) errors.
2019-07-01 08:43:07 +10:00