1
0
mirror of https://github.com/prometheus-community/postgres_exporter.git synced 2025-06-13 06:21:33 +03:00
Commit Graph

605 Commits

Author SHA1 Message Date
3111743f31 Update common Prometheus files
Signed-off-by: prombot <prometheus-team@googlegroups.com>
2025-05-26 17:48:51 +00:00
d1a957f679 Update common Prometheus files (#1159)
Signed-off-by: prombot <prometheus-team@googlegroups.com>
2025-05-17 12:06:43 +02:00
de42ef7de8 Export query itself together with queryId in stat_statement metrics (#940)
* Export query itself together with queryId in stat_statement metrics
* The feature must be enabled via flag.
* Limit length of selected query.

The query is not added to every metrics, but instead of new metric stat_statement_query_id is introduced that contains mapping between queryId and query.

Fixes: #813

---------

Signed-off-by: Jakub Štiller <stiller@2n.cz>
Signed-off-by: Jakub Štiller <jakstiller@atlas.cz>
2025-05-16 10:50:19 +02:00
bd8a6135ec Bump github.com/prometheus/client_golang from 1.21.1 to 1.22.0 (#1154)
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.21.1 to 1.22.0.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.21.1...v1.22.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-version: 1.22.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-06 22:14:44 -04:00
5ade81cb9d Update common Prometheus files (#1155)
Signed-off-by: prombot <prometheus-team@googlegroups.com>
2025-05-06 21:54:01 -04:00
6526065fbc Bump golang.org/x/net from 0.36.0 to 0.38.0 (#1152)
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.36.0 to 0.38.0.
- [Commits](https://github.com/golang/net/compare/v0.36.0...v0.38.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-version: 0.38.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-22 21:26:10 -04:00
5edc331876 Record table only size bytes as well in addition to the total size bytes (#1149)
* Record table only size bytes as well in addition to the total size bytes

Signed-off-by: Felix Yuan <felix.yuan@reddit.com>

* Update collector/pg_stat_user_tables.go

Co-authored-by: Ben Kochie <superq@gmail.com>
Signed-off-by: Felix Yuan <felix.yuan@reddit.com>

* Update collector/pg_stat_user_tables.go

Co-authored-by: Ben Kochie <superq@gmail.com>
Signed-off-by: Felix Yuan <felix.yuan@reddit.com>

* Finish renaming elements to index and table size

Signed-off-by: Felix Yuan <felix.yuan@reddit.com>

---------

Signed-off-by: Felix Yuan <felix.yuan@reddit.com>
Co-authored-by: Ben Kochie <superq@gmail.com>
2025-04-18 16:14:25 +02:00
f8b7139174 Bump github.com/prometheus/common from 0.62.0 to 0.63.0 (#1143)
Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.62.0 to 0.63.0.
- [Release notes](https://github.com/prometheus/common/releases)
- [Changelog](https://github.com/prometheus/common/blob/main/RELEASE.md)
- [Commits](https://github.com/prometheus/common/compare/v0.62.0...v0.63.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/common
  dependency-version: 0.63.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-03 18:18:17 +02:00
43576acc76 Bump github.com/prometheus/client_golang from 1.21.0 to 1.21.1 (#1144)
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.21.0 to 1.21.1.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.21.0...v1.21.1)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-version: 1.21.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-03 18:17:55 +02:00
8d5ec4b3ea Update Go (#1147)
* Update Go to 1.24.
* Update golangci-lint to v2.
* Fixup linting issues.

Signed-off-by: SuperQ <superq@gmail.com>
2025-04-03 17:23:40 +02:00
9e86f1ee38 Adds pg_stat_progress_vacuum collector (#1141)
Signed-off-by: Ian Bibby <ian.bibby@reddit.com>
Co-authored-by: Ben Kochie <superq@gmail.com>
2025-04-03 16:45:29 +02:00
fca2ad84cd Update common Prometheus files (#1142)
Signed-off-by: prombot <prometheus-team@googlegroups.com>
2025-03-30 14:49:06 -04:00
2ce65c324c Update common Prometheus files (#1140)
Signed-off-by: prombot <prometheus-team@googlegroups.com>
2025-03-23 16:54:21 +01:00
b0e61bf263 Bump golang.org/x/net from 0.33.0 to 0.36.0 (#1138)
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.33.0 to 0.36.0.
- [Commits](https://github.com/golang/net/compare/v0.33.0...v0.36.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-16 22:34:30 +01:00
602302ffe2 Update common Prometheus files (#1137)
Signed-off-by: prombot <prometheus-team@googlegroups.com>
2025-03-08 15:00:54 +01:00
457b6fa8cd Bump github.com/prometheus/client_golang from 1.20.5 to 1.21.0 (#1133)
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.20.5 to 1.21.0.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.20.5...v1.21.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-03 18:26:29 +01:00
1e574cf4fd Release v0.17.1 (#1132)
* [BUGFIX] Fix: Handle incoming labels with invalid UTF-8 #1131

Signed-off-by: SuperQ <superq@gmail.com>
v0.17.1
2025-02-26 08:41:27 -05:00
2869087f3c Fix: Handle incoming labels with invalid UTF-8 (#1131)
It's possible that incoming labels will contain invalid UTF-8 characters. This results in a panic. This fix sanitizes the label's string to ensure only valid UTF-8 characters are included, by replacing invalid characters with � (REPLACEMENT CHARACTER)

Signed-off-by: Cooper Worobetz <cooper@worobetz.ca>
2025-02-26 14:21:39 +01:00
51006aba2f Prep for v0.17 (#1127)
Signed-off-by: Joe Adams <github@joeadams.io>
v0.17.0
2025-02-21 17:38:46 -05:00
8bb1a41abf Skip pg_stat_checkpointer collector if pg<17 (#1112)
* fix: skip collector if pg<17

Signed-off-by: Michael Todorovic <michael.todorovic@outlook.com>

* fix: better condition

Signed-off-by: Michael Todorovic <michael.todorovic@outlook.com>

* fix: fix PGStatCheckpointerCollector tests

Signed-off-by: Nicolas Rodriguez <nico@nicoladmin.fr>

---------

Signed-off-by: Michael Todorovic <michael.todorovic@outlook.com>
Signed-off-by: Nicolas Rodriguez <nico@nicoladmin.fr>
Co-authored-by: Michael Todorovic <michael.todorovic@outlook.com>
2025-02-19 21:49:11 -05:00
4c170ed564 Fix missing dsn sanitization for logging (#1104)
This log line was not sanitized previously which could result in logging sensitive information. I have scanned the rest of the files and I don't see anywhere else that DSN is used in a log line without this filter.

Resolves #1042

Signed-off-by: Joe Adams <github@joeadams.io>
2025-02-15 16:35:04 +01:00
99e1b5118c Bump github.com/prometheus/exporter-toolkit from 0.13.2 to 0.14.0 (#1126)
Bumps [github.com/prometheus/exporter-toolkit](https://github.com/prometheus/exporter-toolkit) from 0.13.2 to 0.14.0.
- [Release notes](https://github.com/prometheus/exporter-toolkit/releases)
- [Changelog](https://github.com/prometheus/exporter-toolkit/blob/master/CHANGELOG.md)
- [Commits](https://github.com/prometheus/exporter-toolkit/compare/v0.13.2...v0.14.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/exporter-toolkit
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-15 10:01:47 -05:00
c3885e840a Export last replay age in replication collector (#1085)
The exported replication lag does not handle all failure modes, and can
report 0 for replicas that are out of sync and incapable of recovery.

A proper replacement for that metric would require a different approach
(see e.g. #1007), but for a lot of folks, simply exporting the age of
the last replay can provide a pretty strong signal for something being
amiss.

I think this solution might be preferable to #977, though the lag
metric needs to be fixed or abandoned eventually.

Signed-off-by: Conrad Hoffmann <ch@bitfehler.net>
2025-02-15 09:15:44 -05:00
2ee2a8fa7c feat: add wait/backend to pg_stat_activity (#1106)
Signed-off-by: Felipe Galindo Sanchez <felipe.galindo.sanchez@intel.com>
2025-02-15 09:08:24 -05:00
9e42fc0145 fix: handle pg_replication_slots on pg<13 (#1098)
* fix: handle pg_replication_slots on pg<13

Signed-off-by: Michael Todorovic <michael.todorovic@outlook.com>

* fix: tests

Signed-off-by: Michael Todorovic <michael.todorovic@outlook.com>

---------

Signed-off-by: Michael Todorovic <michael.todorovic@outlook.com>
2025-02-15 09:00:48 -05:00
072864d179 pg_stat_statements PG17 (#1114)
Signed-off-by: Nevermind <79126473+NevermindZ4@users.noreply.github.com>
2025-02-15 08:54:12 -05:00
d85a7710bf Update common Prometheus files (#1124)
Signed-off-by: prombot <prometheus-team@googlegroups.com>
2025-02-14 09:36:03 +01:00
3acc4793fc Bump github.com/prometheus/common from 0.61.0 to 0.62.0 (#1118)
Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.61.0 to 0.62.0.
- [Release notes](https://github.com/prometheus/common/releases)
- [Changelog](https://github.com/prometheus/common/blob/main/RELEASE.md)
- [Commits](https://github.com/prometheus/common/compare/v0.61.0...v0.62.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/common
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-13 03:35:38 +01:00
7d4c278221 Add Postgres 17 for CI test (#1105)
Signed-off-by: Khiem Doan <doankhiem.crazy@gmail.com>
2025-01-12 21:24:15 -05:00
9de4f19d43 Update common Prometheus files (#1110)
Signed-off-by: prombot <prometheus-team@googlegroups.com>
2025-01-07 21:20:19 +01:00
ecb5ec5dff Update common Prometheus files (#1090)
Signed-off-by: prombot <prometheus-team@googlegroups.com>
2025-01-07 09:28:42 +01:00
bea2609519 Checkpoint related columns in PG 17 have been moved from pg_stat_bgwriter to pg_stat_checkpointer (#1072)
* Checkpoint related columns in PG 17 have been moved from pg_stat_bgwriter to pg_stat_checkpointer

Fix https://github.com/prometheus-community/postgres_exporter/issues/1060

See: https://www.dbi-services.com/blog/postgresql-17-new-catalog-view-pg_stat_checkpointer/
Signed-off-by: Nicolas Rodriguez <nico@nicoladmin.fr>

* Add support for pg_stat_checkpointer

See: https://www.dbi-services.com/blog/postgresql-17-new-catalog-view-pg_stat_checkpointer/
Signed-off-by: Nicolas Rodriguez <nico@nicoladmin.fr>

* Run integration tests with Postgres 17

Signed-off-by: Nicolas Rodriguez <nico@nicoladmin.fr>

* Update date in file header

Signed-off-by: Nicolas Rodriguez <nico@nicoladmin.fr>

---------

Signed-off-by: Nicolas Rodriguez <nico@nicoladmin.fr>
2025-01-01 16:03:43 -05:00
5145620988 Bump github.com/prometheus/exporter-toolkit from 0.13.1 to 0.13.2 (#1108)
Bumps [github.com/prometheus/exporter-toolkit](https://github.com/prometheus/exporter-toolkit) from 0.13.1 to 0.13.2.
- [Release notes](https://github.com/prometheus/exporter-toolkit/releases)
- [Changelog](https://github.com/prometheus/exporter-toolkit/blob/master/CHANGELOG.md)
- [Commits](https://github.com/prometheus/exporter-toolkit/compare/v0.13.1...v0.13.2)

---
updated-dependencies:
- dependency-name: github.com/prometheus/exporter-toolkit
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-01 18:36:32 +01:00
5bb1702321 Fix to replace dashes with underscore in the metric names (#1103)
* Fix to replace dashes with underscore in the metric names

Signed-off-by: aagarwalla-fx <arpit.agarwalla@falconx.io>

* Code style fix

Signed-off-by: aagarwalla-fx <arpit.agarwalla@falconx.io>

---------

Signed-off-by: aagarwalla-fx <arpit.agarwalla@falconx.io>
2024-12-22 16:14:19 -05:00
6f36adfadf Update pg_long_running_transactions.go (#1092)
To extract time in seconds for pg_long_running_transactions_oldest_timestamp_seconds query which currently return epoch time.

Signed-off-by: Jyothi Kiran Thammana <147131742+jyothikirant-sayukth@users.noreply.github.com>
2024-12-22 15:09:35 -05:00
a324fe37bc Fix version header in changelog (#1089)
Signed-off-by: Joe Adams <github@joeadams.io>
v0.16.0
2024-11-10 16:05:34 -05:00
4abdfa5bfd Update changelog and version for a v0.16.0 release (#1088)
Signed-off-by: Joe Adams <github@joeadams.io>
2024-11-10 15:55:46 -05:00
0045c4f93e Update common Prometheus files (#1087)
Signed-off-by: prombot <prometheus-team@googlegroups.com>
2024-11-08 19:51:27 +01:00
340a104d25 Bump github.com/prometheus/exporter-toolkit from 0.13.0 to 0.13.1 (#1081)
Bumps [github.com/prometheus/exporter-toolkit](https://github.com/prometheus/exporter-toolkit) from 0.13.0 to 0.13.1.
- [Release notes](https://github.com/prometheus/exporter-toolkit/releases)
- [Changelog](https://github.com/prometheus/exporter-toolkit/blob/master/CHANGELOG.md)
- [Commits](https://github.com/prometheus/exporter-toolkit/compare/v0.13.0...v0.13.1)

---
updated-dependencies:
- dependency-name: github.com/prometheus/exporter-toolkit
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-06 18:48:19 +01:00
c52405ab48 Update common Prometheus files (#1083)
Signed-off-by: prombot <prometheus-team@googlegroups.com>
2024-11-06 18:47:57 +01:00
552ff92f8b Make walreceiver collector useful w/o repmgr (#1086)
In a streaming replication setup that was created without replication
manager (`repmgr`), the `stat_wal_receiver` collector does not return
any metrics, because one value it wants to export is not present.

This is rather overly opinionated. The missing metric is comparatively
uninteresting and does not justify discarding all the others. And
replication setups created without `repmgr` are not exactly rare.

This commit makes the one relevant metric optional and simply skips it
if the respective value cannot be determined.

Signed-off-by: Conrad Hoffmann <ch@bitfehler.net>
2024-11-06 18:47:30 +01:00
f9c74570ed Bump github.com/prometheus/common from 0.60.0 to 0.60.1 (#1080)
Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.60.0 to 0.60.1.
- [Release notes](https://github.com/prometheus/common/releases)
- [Changelog](https://github.com/prometheus/common/blob/main/RELEASE.md)
- [Commits](https://github.com/prometheus/common/compare/v0.60.0...v0.60.1)

---
updated-dependencies:
- dependency-name: github.com/prometheus/common
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-27 21:28:26 +01:00
071ebb6244 Bump github.com/prometheus/client_golang from 1.20.4 to 1.20.5 (#1079)
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.20.4 to 1.20.5.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.20.4...v1.20.5)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-26 22:28:29 +02:00
e8540767e4 chore!: adopt log/slog, drop go-kit/log (#1073)
* ci: update go to version 1.23

Signed-off-by: TJ Hoplock <t.hoplock@gmail.com>

* build(deps): bump prometheus/{client_golang,common,exporter-toolkit}

Signed-off-by: TJ Hoplock <t.hoplock@gmail.com>

* chore!: adopt log/slog, drop go-kit/log

The bulk of this change set was automated by the following script which
is being used to aid in converting the various exporters/projects to use
slog:

https://gist.github.com/tjhop/49f96fb7ebbe55b12deee0b0312d8434

Signed-off-by: TJ Hoplock <t.hoplock@gmail.com>

---------

Signed-off-by: TJ Hoplock <t.hoplock@gmail.com>
Co-authored-by: Ben Kochie <superq@gmail.com>
2024-10-26 21:44:17 +02:00
3743987494 Update common Prometheus files (#1076)
Signed-off-by: prombot <prometheus-team@googlegroups.com>
2024-10-26 16:37:52 +02:00
3be4edccd4 Update common Prometheus files (#983)
Signed-off-by: prombot <prometheus-team@googlegroups.com>
2024-10-17 17:47:21 +02:00
98f75c7e7e stop logging errors on replicas, fixes #547 (#1048)
Signed-off-by: Steffen Zieger <github@saz.sh>
2024-09-05 09:28:31 -04:00
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
49f66e1bfb fix: Only query active_time on pg>=14 (#1045)
Signed-off-by: MarcWort <113890636+MarcWort@users.noreply.github.com>
2024-06-25 09:15:21 -04:00
a4ac0e6747 feat: Add safe_wal_size and wal_status to replication_slot (#1027)
* feat: Add safe_wal_size to replication_slot

Signed-off-by: MarcWort <113890636+MarcWort@users.noreply.github.com>

* feat: Add wal_status to replication_slot

Signed-off-by: MarcWort <113890636+MarcWort@users.noreply.github.com>

---------

Signed-off-by: MarcWort <113890636+MarcWort@users.noreply.github.com>
2024-05-11 14:59:55 +02:00