Skip to content

Conversation

@BupycHuk
Copy link

No description provided.

Eric-Tyrrell22 and others added 10 commits September 19, 2023 21:40
Signed-off-by: Eric tyrrell <[email protected]>
Another case of untyped integer overflows on 32-bit arch.

Signed-off-by: Daniel Swarbrick <[email protected]>
Run Go tests with 32-bit to validate value overflow.

Signed-off-by: SuperQ <[email protected]>
* Bump github.com/prometheus/client_golang from 1.16.0 to 1.17.0

Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.16.0 to 1.17.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.16.0...v1.17.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]>

* Update tests for latest client_golang.

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

---------

Signed-off-by: dependabot[bot] <[email protected]>
Signed-off-by: SuperQ <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: SuperQ <[email protected]>
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.10.0 to 0.17.0.
- [Commits](golang/net@v0.10.0...v0.17.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>
* [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 <[email protected]>
@it-percona-cla
Copy link

it-percona-cla commented Nov 15, 2023

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
0 out of 4 committers have signed the CLA.

❌ prombot
❌ avances123
❌ sysadmind
❌ pierresouchay
You have signed the CLA already but the status is still pending? Let us recheck it.

prombot and others added 19 commits November 23, 2023 09:42
Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.44.0 to 0.45.0.
- [Release notes](https://github.com/prometheus/common/releases)
- [Commits](prometheus/common@v0.44.0...v0.45.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>
Bumps [github.com/prometheus/client_model](https://github.com/prometheus/client_model) from 0.4.1-0.20230718164431-9a2bf3000d16 to 0.5.0.
- [Release notes](https://github.com/prometheus/client_model/releases)
- [Commits](https://github.com/prometheus/client_model/commits/v0.5.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_model
  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>
* feat(pg_stat_database): active time metric

---------

Signed-off-by: Jiri Sveceny <[email protected]>
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.14.0 to 0.17.0.
- [Commits](golang/crypto@v0.14.0...v0.17.0)

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

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.17.0 to 1.18.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.17.0...v1.18.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>
This is the only log message which didn't specify a level in the
postgres_exporter. I am unsure if this log message should be info or
debug, but leaning towards the more important since previously it would
just always log.

The way I validated this was the only non-leveled logger was via grep.
Both of these only returned this callsite previously:

  git grep 'logger\.Log'
  git grep '\.Log(' | grep -v level

Signed-off-by: Keegan Carruthers-Smith <[email protected]>
* Add database connection limits metrics

Signed-off-by: Jocelyn Thode <[email protected]>

* Add roles connection limits metrics

Signed-off-by: Jocelyn Thode <[email protected]>

* Fix copyright year

Co-authored-by: Joe Adams <[email protected]>
Signed-off-by: Jocelyn Thode <[email protected]>

* Fix spacing in pgDatabaseQuery

Co-authored-by: Joe Adams <[email protected]>
Signed-off-by: Jocelyn Thode <[email protected]>

* Fix case on pgRolesConnectionLimitsQuery

Co-authored-by: Joe Adams <[email protected]>
Signed-off-by: Jocelyn Thode <[email protected]>

* Do not add roleMetrics when row is not valid

Signed-off-by: Jocelyn Thode <[email protected]>

---------

Signed-off-by: Jocelyn Thode <[email protected]>
Signed-off-by: Jocelyn Thode <[email protected]>
Co-authored-by: Joe Adams <[email protected]>
Bumps [github.com/DATA-DOG/go-sqlmock](https://github.com/DATA-DOG/go-sqlmock) from 1.5.0 to 1.5.2.
- [Release notes](https://github.com/DATA-DOG/go-sqlmock/releases)
- [Commits](DATA-DOG/go-sqlmock@v1.5.0...v1.5.2)

---
updated-dependencies:
- dependency-name: github.com/DATA-DOG/go-sqlmock
  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/client_golang](https://github.com/prometheus/client_golang) from 1.18.0 to 1.19.0.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/v1.19.0/CHANGELOG.md)
- [Commits](prometheus/client_golang@v1.18.0...v1.19.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 [github.com/prometheus/client_model](https://github.com/prometheus/client_model) from 0.5.0 to 0.6.0.
- [Release notes](https://github.com/prometheus/client_model/releases)
- [Commits](prometheus/client_model@v0.5.0...v0.6.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_model
  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 google.golang.org/protobuf from 1.32.0 to 1.33.0.

---
updated-dependencies:
- dependency-name: google.golang.org/protobuf
  dependency-type: indirect
...

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.10.0 to 0.11.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.10.0...v0.11.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>
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.20.0 to 0.23.0.
- [Commits](golang/net@v0.20.0...v0.23.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>
* feat: Add safe_wal_size to replication_slot

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

* feat: Add wal_status to replication_slot

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

---------

Signed-off-by: MarcWort <[email protected]>
Better example for the quick start with prometheus config and avoiding deprecated env variables.

Signed-off-by: fhackenberger <[email protected]>
cristiangreco and others added 19 commits July 25, 2025 10:28
* 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>
@JiriCtvrtka
Copy link

JiriCtvrtka commented Dec 3, 2025

I believe we can close this PR because this one #311 is newer.

dependabot bot and others added 10 commits December 10, 2025 09:06
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>
* Update GitHub Actions config to run tests

Signed-off-by: Joe Adams <[email protected]>

* Add CI steps for release and include all postgres versions

Signed-off-by: Joe Adams <[email protected]>

* Disable circleci jobs

This will stop the CI jobs but leave existing PRs in place until we can get those updated.

Signed-off-by: Joe Adams <[email protected]>

---------

Signed-off-by: Joe Adams <[email protected]>
When there are no long running transactions, the oldest timestamp will be NULL. This sets the metrics value to 0 (age). Also adds a test for this behavior.

Fixes #1223

Signed-off-by: Joe Adams <[email protected]>
Signed-off-by: prombot <[email protected]>
Co-authored-by: Cristian Greco <[email protected]>
Add documentation for stat_checkpointer collector

Signed-off-by: Fabio Rueda <[email protected]>
…austing PG connections (#1229)

* Ensure collection returns within a specified delay

**Context**: As explained in #1228, when database is very slow to answer, every call to prometheus exporter might consume a new connection and possibly consume all available connections

**Solution**: Ensure a Context with a specified Timeout is specified, so the connection will end if duration of collection is too long

Signed-off-by: Pierre Souchay <[email protected]>

* test: added TestPGDatabaseTimeout to ensure our timing behaves as it should

Signed-off-by: Pierre Souchay <[email protected]>

* document the new variable `PG_EXPORTER_COLLECTION_TIMEOUT` in the README.md

Signed-off-by: Pierre SOUCHAY <[email protected]>

* CollectionTimeout -> WithCollectionTimeout

Signed-off-by: Pierre SOUCHAY <[email protected]>

* Document and report 0 value for PG_EXPORTER_COLLECTION_TIMEOUT

Signed-off-by: Pierre SOUCHAY <[email protected]>

* move test to the right place

Signed-off-by: Pierre SOUCHAY <[email protected]>

* ensure that UTest do not take too much time

Signed-off-by: Pierre SOUCHAY <[email protected]>

---------

Signed-off-by: Pierre Souchay <[email protected]>
Signed-off-by: Pierre SOUCHAY <[email protected]>
Co-authored-by: Pierre SOUCHAY <[email protected]>
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.