Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PMM-13899 pull upstream changes v0.17.1 #311

Open
wants to merge 56 commits into
base: main
Choose a base branch
from

Conversation

BupycHuk
Copy link
Member

@BupycHuk BupycHuk commented Mar 24, 2025

prombot and others added 30 commits November 14, 2023 22:03
…ommunity#948)

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>
…-community#961)

* 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>
…theus-community#993)

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>
…ty#1003)

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]>
…s-community#997)

* 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]>
…ommunity#1000)

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>
…theus-community#1011)

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>
…us-community#1010)

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>
…munity#1014)

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>
…ometheus-community#992)

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>
…s-community#1027)

* 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]>
* ci: update go to version 1.23

Signed-off-by: TJ Hoplock <[email protected]>

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

Signed-off-by: TJ Hoplock <[email protected]>

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

---------

Signed-off-by: TJ Hoplock <[email protected]>
Co-authored-by: Ben Kochie <[email protected]>
…theus-community#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](prometheus/client_golang@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] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…ommunity#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](prometheus/common@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] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
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 <[email protected]>
…ometheus-community#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](prometheus/exporter-toolkit@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] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
dependabot bot and others added 14 commits February 13, 2025 03:35
…ommunity#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](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]>
…#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. prometheus-community#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 prometheus-community#977, though the lag
metric needs to be fixed or abandoned eventually.

Signed-off-by: Conrad Hoffmann <[email protected]>
…ometheus-community#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](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 prometheus-community#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]>
…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 <[email protected]>
* [BUGFIX] Fix: Handle incoming labels with invalid UTF-8 prometheus-community#1131

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

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCgAdFiEEoFiTUofnXYMugU5GxkayPJ4yRfEFAme/HEkACgkQxkayPJ4y
# RfFouRAAgSwPJ3YTvi4CeNvgrRTQrFsYK8NF7evyGPUZi2nWQm9XP+eW3zQt0Pxr
# AMw2JkibUow7KGGuzAbEY07FyK+yY3JgMBf9+g1nymMEGiT+rA/cvLZnEU5CrP8P
# VdLxKfB1kz/iVHKSmAo7WKF0TP1Dso/Oma56J594ACpxarI2UVQtBGKhk8LUvcGH
# 1Yd0ji2FtezU3M17vZAoZru0ZcS1bbyxP5u6tz6+zqrxHbtFp+aMRAoghc1bafO0
# OgbXvVr8qqKwVvvD2Nt6kDo7iCazQINp5FsMGVKuFyMLxLv9ohaVBV1Lwx11+Ts1
# fRqMz5Co1dYUusic68CnOWRZ8iJrZysi/Jxv/lG1U/5fgIfYMu2CzlgfNZnWTAYw
# 1IRKoMBsmg6zg67Xq959pyB9HgultpjMHp0pVOasFJa40QWNuYp0V8B0SpHzZQ1Q
# gckQBByFHDKM1XGtM6MMbCamKU38MiYKJ8OtIZ/I4jlM7bA0IINvZt2o5ZMWl3OO
# 7Bx2V/MxeEyowrVmb80NeAjm+FMrMFNpW2mGUnzwMmTXdkv5kvZLW3wBx71tYSnF
# O3AD227WnosnjGepVU5iBAIoEP+tI6Pm6D80jPHvlOCl5T+hp+f4y7BnTEnizmz2
# yVKzhiOVutkFQHa2tDw9WC+eeKLD7A7z718R2PLyQARweTwuZ1Y=
# =umzG
# -----END PGP SIGNATURE-----
# gpg: Signature made Wed Feb 26 16:51:05 2025 +03
# gpg:                using RSA key A058935287E75D832E814E46C646B23C9E3245F1
# gpg: Can't check signature: No public key

# Conflicts:
#	.github/workflows/golangci-lint.yml
#	cmd/postgres_exporter/datasource.go
#	cmd/postgres_exporter/main.go
#	cmd/postgres_exporter/namespace.go
#	cmd/postgres_exporter/postgres_exporter.go
#	cmd/postgres_exporter/probe.go
#	collector/pg_replication_slot.go
#	collector/pg_replication_slot_test.go
#	collector/pg_stat_bgwriter.go
#	collector/pg_stat_bgwriter_test.go
#	collector/probe.go
#	go.mod
#	go.sum
@BupycHuk BupycHuk requested a review from a team as a code owner March 24, 2025 11:21
@it-percona-cla
Copy link

it-percona-cla commented Mar 24, 2025

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.
1 out of 21 committers have signed the CLA.

✅ BupycHuk
❌ prombot
❌ shamil
❌ sitole
❌ keegancsmith
❌ jocelynthode
❌ tjhop
❌ saz
❌ sysadmind
❌ jyothikirant-sayukth
❌ n-rodriguez
❌ khiemdoan
❌ michael-todorovic
❌ vancwo
❌ MarcWort
❌ aagarwalla-fx
❌ NevermindZ4
❌ fhackenberger
❌ fgalind1
❌ bitfehler
❌ SuperQ
You have signed the CLA already but the status is still pending? Let us recheck it.

Cleaned up `go.mod` and `go.sum` by removing `github.com/go-kit/log` and `github.com/go-logfmt/logfmt`, which are no longer used in the project. This helps keep the dependency list minimal and maintains a cleaner project state.
Copy link
Member

@ademidoff ademidoff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at the test failures, I believe there should be a way to make the tests pass. WDYT?

PushDockerHubReadme:
runs-on: ubuntu-latest
name: Push README to Docker Hub
if: github.repository_owner == 'prometheus' || github.repository_owner == 'prometheus-community' # Don't run this workflow on forks.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That action will never execute with such an if statement, so why not remove it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to not have conflicts when we pull new version.

This change introduces the "plugin" label to pg_replication_slot metrics, providing more detailed information about the replication slot. The updated metrics now include the plugin name alongside existing labels, improving observability and filtering capabilities.
@BupycHuk BupycHuk requested a review from ademidoff March 25, 2025 08:59
@ademidoff
Copy link
Member

Shall we have a feature build for this update?

@BupycHuk
Copy link
Member Author

attached link to FB

@BupycHuk BupycHuk changed the title PMM-7 pull upstream changes v0.17.1 PMM-13899 pull upstream changes v0.17.1 Mar 26, 2025
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.