Skip to content

Conversation

@Schmaetz
Copy link
Owner

@Schmaetz Schmaetz commented Dec 1, 2025

No description provided.

jyothikirant-sayukth and others added 30 commits December 22, 2024 15:09
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 <[email protected]>
* Fix to replace dashes with underscore in the metric names

Signed-off-by: aagarwalla-fx <[email protected]>

* Code style fix

Signed-off-by: aagarwalla-fx <[email protected]>

---------

Signed-off-by: aagarwalla-fx <[email protected]>
)

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](prometheus/exporter-toolkit@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] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…iter to pg_stat_checkpointer (#1072)

* Checkpoint related columns in PG 17 have been moved from pg_stat_bgwriter to pg_stat_checkpointer

Fix #1060

See: https://www.dbi-services.com/blog/postgresql-17-new-catalog-view-pg_stat_checkpointer/
Signed-off-by: Nicolas Rodriguez <[email protected]>

* 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 <[email protected]>

* Run integration tests with Postgres 17

Signed-off-by: Nicolas Rodriguez <[email protected]>

* Update date in file header

Signed-off-by: Nicolas Rodriguez <[email protected]>

---------

Signed-off-by: Nicolas Rodriguez <[email protected]>
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](prometheus/common@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] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* fix: handle pg_replication_slots on pg<13

Signed-off-by: Michael Todorovic <[email protected]>

* fix: tests

Signed-off-by: Michael Todorovic <[email protected]>

---------

Signed-off-by: Michael Todorovic <[email protected]>
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 <[email protected]>
)

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](prometheus/exporter-toolkit@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] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
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 <[email protected]>
* fix: skip collector if pg<17

Signed-off-by: Michael Todorovic <[email protected]>

* fix: better condition

Signed-off-by: Michael Todorovic <[email protected]>

* fix: fix PGStatCheckpointerCollector tests

Signed-off-by: Nicolas Rodriguez <[email protected]>

---------

Signed-off-by: Michael Todorovic <[email protected]>
Signed-off-by: Nicolas Rodriguez <[email protected]>
Co-authored-by: Michael Todorovic <[email protected]>
Signed-off-by: Joe Adams <[email protected]>
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 <[email protected]>
* [BUGFIX] Fix: Handle incoming labels with invalid UTF-8 #1131

Signed-off-by: SuperQ <[email protected]>
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](prometheus/client_golang@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] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.33.0 to 0.36.0.
- [Commits](golang/net@v0.33.0...v0.36.0)

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

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: Ian Bibby <[email protected]>
Co-authored-by: Ben Kochie <[email protected]>
* Update Go to 1.24.
* Update golangci-lint to v2.
* Fixup linting issues.

Signed-off-by: SuperQ <[email protected]>
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](prometheus/client_golang@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] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
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](prometheus/common@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] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…tes (#1149)

* Record table only size bytes as well in addition to the total size bytes

Signed-off-by: Felix Yuan <[email protected]>

* Update collector/pg_stat_user_tables.go

Co-authored-by: Ben Kochie <[email protected]>
Signed-off-by: Felix Yuan <[email protected]>

* Update collector/pg_stat_user_tables.go

Co-authored-by: Ben Kochie <[email protected]>
Signed-off-by: Felix Yuan <[email protected]>

* Finish renaming elements to index and table size

Signed-off-by: Felix Yuan <[email protected]>

---------

Signed-off-by: Felix Yuan <[email protected]>
Co-authored-by: Ben Kochie <[email protected]>
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.36.0 to 0.38.0.
- [Commits](golang/net@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] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
BoweFlex and others added 30 commits May 29, 2025 07:53
* Update querySettings Error Return in Scrape

If there are errors querying namespace mappings, the potential error from querySettings is obscured. Adding an immediate return if there are errors retreiving settings.

Signed-off-by: Jonathan Bowe <[email protected]>

* Improve Verbosity of queryNamespaceMappings Errors

Previously if any errors were encountered by queryNamespaceMappings, only a count of those errors was returned - making debugging those errors harder than it needs to be.

I'm changing this to immediately return nil if no errors are encountered, and otherwise an error will be formatted with each of the namespaces and what the error was for that namespace.

Signed-off-by: Jonathan Bowe <[email protected]>

* Simplify Error Message

Co-authored-by: Ben Kochie <[email protected]>
Signed-off-by: Jonathan Bowe <[email protected]>

---------

Signed-off-by: Jonathan Bowe <[email protected]>
Signed-off-by: Jonathan Bowe <[email protected]>
Co-authored-by: Ben Kochie <[email protected]>
* Add a collector for pg_buffercache_summary()
* Requires PostgreSQL >= 16.
---------

Signed-off-by: Peter Nuttall <[email protected]>
Co-authored-by: Ben Kochie <[email protected]>
Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.63.0 to 0.64.0.
- [Release notes](https://github.com/prometheus/common/releases)
- [Changelog](https://github.com/prometheus/common/blob/main/RELEASE.md)
- [Commits](prometheus/common@v0.63.0...v0.64.0)

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

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.64.0 to 0.65.0.
- [Release notes](https://github.com/prometheus/common/releases)
- [Changelog](https://github.com/prometheus/common/blob/main/RELEASE.md)
- [Commits](prometheus/common@v0.64.0...v0.65.0)

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

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Minor fixes as I was skimming through:
- fix typo in `stat_statements`
- drop custom `sliceContains` in `database`

Signed-off-by: Cristian Greco <[email protected]>
Signed-off-by: Sam DeHaan <[email protected]>
Signed-off-by: Sam DeHaan <[email protected]>
Co-authored-by: Sam DeHaan <[email protected]>
Co-authored-by: Sam DeHaan <[email protected]>
* Update mixin to latest changes from grafana/postgres_exporter

Porting a bunch of PRs accumulated over time in grafana/postgres_exporter:

- grafana#11 (@v-zhuravlev)
- grafana#12 (@gaantunes)
- grafana#13 (@gaantunes)
- grafana#14 (@gaantunes)
- grafana#15 (@gaantunes)
- grafana#16 (@gaantunes)
- grafana#17 (@gaantunes)
- grafana#20 (@gaantunes)
- grafana#21 (@mshahzeb)
- grafana#22 (@mshahzeb)

Signed-off-by: Cristian Greco <[email protected]>

* rename dashboard to old name

Signed-off-by: Cristian Greco <[email protected]>

* remove custom selector

Signed-off-by: Cristian Greco <[email protected]>

---------

Signed-off-by: Cristian Greco <[email protected]>
Co-authored-by: Vitaly <[email protected]>
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.22.0 to 1.23.0.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](prometheus/client_golang@v1.22.0...v1.23.0)

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

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
)

To reduce the observer effect, filter out pg_stat_activity rows of the
postgres_exporter session from all SA queries, based on pid / procpid.

A bit annoying to see idling DBs showing pg_stat_activity_count "active"
count of 1

Signed-off-by: Kaarel Moppel <[email protected]>
-	Update github.com/prometheus/client_golang to v1.23.1
-	Update github.com/prometheus/common to v0.66.1
-	Update github.com/prometheus/exporter-toolkit to v0.14.1

Signed-off-by: Cristian Greco <[email protected]>
* Prepare release `0.18.0`

* [FEATURE] Add `stat_progress_vacuum` collector by @ianbibby
* [FEATURE] Add `buffercache_summary` collector by @sfc-gh-pnuttall
* [FEATURE] `stat_statements`: export query itself together with `queryId` by @Delorien84
* [ENHANCEMENT] Update Go version by @SuperQ
* [ENHANCEMENT] Improve error handling for `Server.Scrape` by @BoweFlex
* [ENHANCEMENT] `stat_user_tables`: record table-only size bytes in addition to the total size bytes by @Sticksman
* [ENHANCEMENT] (chore) Fix a typo and use `slices.Contains` by @cristiangreco
* [ENHANCEMENT] Update mixin to latest changes from `grafana/postgres_exporter` by @cristiangreco, @gaantunes, @v-zhuravlev and @mshahzeb
* [ENHANCEMENT] Exclude the metrics fetching session's data from pg_stat_activity by @kmoppel
* [BUGFIX] Ensure database connections are always closed by @cristiangreco and @dehaansa

Signed-off-by: Cristian Greco <[email protected]>

* rm entry about go update

Co-authored-by: Joe Adams <[email protected]>
Signed-off-by: Cristian Greco <[email protected]>

* add PRs

Signed-off-by: Cristian Greco <[email protected]>

* update date

Signed-off-by: Cristian Greco <[email protected]>

---------

Signed-off-by: Cristian Greco <[email protected]>
Co-authored-by: Joe Adams <[email protected]>
…lector (#1198)

In `pgStatWalReceiverQueryTemplate`, the order of the columns (when `hasFlushedLSN == true`) is:

- ...
- `receive_start_lsn`
- `flushed_lsn`
- `receive_start_tli`
- ...

However, columns were scanned in this order:

- ...
- `receive_start_lsn` -> `receiveStartLsn`
- `receive_start_tli` -> `flushedLsn` (!)
- `flushed_lsn` -> `receiveStartTli` (!)
- ...

This incorrect hydration of variables also manifests as swapped values for the
`pg_stat_wal_receiver_flushed_lsn` and `pg_stat_wal_receiver_receive_start_tli` metrics.

This seems to be a bug that has existed since the initial implementation:

- 2d7e152
- #844

In this patch, I'm:

- fixing the `.Scan()`, so that it hydrates variables in the correct order

- adjusting the order in which metrics are pushed out to the channel,
  to follow the order we consume them in
  (.., `receive_start_lsn`, `flushed_lsn`, `receive_start_tli`, ..)

- adjusting the walreceiver tests, to follow the new order (which matches .`Scan()`)

- fixing a small identation issue in `pgStatWalReceiverQueryTemplate`

Signed-off-by: Slavi Pantaleev <[email protected]>
This semicolon breaks the query

Signed-off-by: Joe Adams <[email protected]>
Co-authored-by: Joe Adams <[email protected]>
* [BUGFIX] Fix swapped `flushedLsn` and `receiveStartTli` for `wal_receiver` collector by @spantaleev in #1198
* [BUGFIX] Fix superfluous semicolon breaking query in `process_idle` by @sysadmind in #1197 and #1201

Signed-off-by: Cristian Greco <[email protected]>
* Update minimum supported Go to 1.24.0.
* Update Go build to 1.25.x.
* Update PostgreSQL testing versions.

Signed-off-by: SuperQ <[email protected]>
Add `.limit` CLI flag to `stat_statements` collector to allow
setting a custom number of queries to be returned.

Signed-off-by: Cristian Greco <[email protected]>
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.23.1 to 1.23.2.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](prometheus/client_golang@v1.23.1...v1.23.2)

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

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Add the pprof package to allow debug profiling.

Related: #1189

Signed-off-by: SuperQ <[email protected]>
Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.66.1 to 0.67.2.
- [Release notes](https://github.com/prometheus/common/releases)
- [Changelog](https://github.com/prometheus/common/blob/main/CHANGELOG.md)
- [Commits](prometheus/common@v0.66.1...v0.67.2)

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

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
)

Bumps [github.com/prometheus/exporter-toolkit](https://github.com/prometheus/exporter-toolkit) from 0.14.1 to 0.15.0.
- [Release notes](https://github.com/prometheus/exporter-toolkit/releases)
- [Commits](prometheus/exporter-toolkit@v0.14.1...v0.15.0)

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

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Update common Prometheus files

Signed-off-by: prombot <[email protected]>

* Fix linting issues.

Signed-off-by: SuperQ <[email protected]>

---------

Signed-off-by: prombot <[email protected]>
Signed-off-by: SuperQ <[email protected]>
Co-authored-by: SuperQ <[email protected]>
Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.67.2 to 0.67.4.
- [Release notes](https://github.com/prometheus/common/releases)
- [Changelog](https://github.com/prometheus/common/blob/main/CHANGELOG.md)
- [Commits](prometheus/common@v0.67.2...v0.67.4)

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

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.43.0 to 0.45.0.
- [Commits](golang/crypto@v0.43.0...v0.45.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-version: 0.45.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.