Skip to content

fix: Do not crash on bad pg_settings value#1252

Merged
SuperQ merged 3 commits intoprometheus-community:masterfrom
sysadmind:fix-setting-unit
Feb 2, 2026
Merged

fix: Do not crash on bad pg_settings value#1252
SuperQ merged 3 commits intoprometheus-community:masterfrom
sysadmind:fix-setting-unit

Conversation

@sysadmind
Copy link
Contributor

pg_settings metrics would panic when the parsing fails. This is a poor experience for users. An exporter should not panic. This skips unparsable metrics and instead logs a warning.

fixes #1240

These tests are weird, but I think that's a future PR as we refactor.

pg_settings metrics would panic when the parsing fails. This is a poor experience for users. An exporter should not panic. This skips unparsable metrics and instead logs a warning.

fixes prometheus-community#1240

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

@cristiangreco cristiangreco left a comment

Choose a reason for hiding this comment

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

Left just a nitpick comment.

@gaeldb
Copy link

gaeldb commented Feb 2, 2026

@SuperQ can you please review?

Copy link
Contributor

@SuperQ SuperQ left a comment

Choose a reason for hiding this comment

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

Looks good, minor cleanup needed.

Remove panic comment for unsupported vartype.

Signed-off-by: Joe Adams <github@joeadams.io>
@SuperQ SuperQ merged commit 9cb9648 into prometheus-community:master Feb 2, 2026
15 checks passed
@evgenipetrov9
Copy link

When is the next release due with this fix included?

@gaeldb
Copy link

gaeldb commented Feb 3, 2026

Thank you all for this+++

@cristiangreco
Copy link
Contributor

When is the next release due with this fix included?

Planning to cut a release this week

@evgenipetrov9
Copy link

Not really a fan of having this be logged every 30 seconds. That's 43200 logs per deployment per day

cristiangreco added a commit that referenced this pull request Feb 16, 2026
Followup of #1252

Ignore this setting altogether, as logging a warn at each scrape
for a cloud provider specific entry seems a waste of resources.
cristiangreco added a commit that referenced this pull request Feb 16, 2026
Followup of #1252

Ignore this setting altogether, as logging a warn at each scrape
for a cloud provider specific entry seems a waste of resources.

Signed-off-by: Cristian Greco <cristian@regolo.cc>
@cristiangreco
Copy link
Contributor

Not really a fan of having this be logged every 30 seconds. That's 43200 logs per deployment per day

Agree with the log being annoying in this case, unfortunately. Followed up with #1261

cristiangreco added a commit that referenced this pull request Feb 18, 2026
Followup of #1252

Ignore this setting altogether, as logging a warn at each scrape
for a cloud provider specific entry seems a waste of resources.

Signed-off-by: Cristian Greco <cristian@regolo.cc>
sysadmind pushed a commit that referenced this pull request Feb 18, 2026
* fix: ignore setting `google_dataplex.max_messages`

Followup of #1252

Ignore this setting altogether, as logging a warn at each scrape
for a cloud provider specific entry seems a waste of resources.

Signed-off-by: Cristian Greco <cristian@regolo.cc>

* add comment

Signed-off-by: Cristian Greco <cristian@regolo.cc>

---------

Signed-off-by: Cristian Greco <cristian@regolo.cc>
JiriCtvrtka pushed a commit to percona/postgres_exporter that referenced this pull request Feb 26, 2026
…ity#1261)

* fix: ignore setting `google_dataplex.max_messages`

Followup of prometheus-community#1252

Ignore this setting altogether, as logging a warn at each scrape
for a cloud provider specific entry seems a waste of resources.

Signed-off-by: Cristian Greco <cristian@regolo.cc>

* add comment

Signed-off-by: Cristian Greco <cristian@regolo.cc>

---------

Signed-off-by: Cristian Greco <cristian@regolo.cc>
dev-blueMagician added a commit to dev-blueMagician/postgres_exporter that referenced this pull request Mar 3, 2026
* fix: ignore setting `google_dataplex.max_messages`

Followup of prometheus-community/postgres_exporter#1252

Ignore this setting altogether, as logging a warn at each scrape
for a cloud provider specific entry seems a waste of resources.

Signed-off-by: Cristian Greco <cristian@regolo.cc>

* add comment

Signed-off-by: Cristian Greco <cristian@regolo.cc>

---------

Signed-off-by: Cristian Greco <cristian@regolo.cc>
@evgenipetrov9
Copy link

Not really a fan of having this be logged every 30 seconds. That's 43200 logs per deployment per day

cristiangreco added a commit that referenced this pull request Feb 16, 2026
Followup of #1252

Ignore this setting altogether, as logging a warn at each scrape
for a cloud provider specific entry seems a waste of resources.
cristiangreco added a commit that referenced this pull request Feb 16, 2026
Followup of #1252

Ignore this setting altogether, as logging a warn at each scrape
for a cloud provider specific entry seems a waste of resources.

Signed-off-by: Cristian Greco <cristian@regolo.cc>
@cristiangreco
Copy link
Contributor

Not really a fan of having this be logged every 30 seconds. That's 43200 logs per deployment per day

Agree with the log being annoying in this case, unfortunately. Followed up with #1261

cristiangreco added a commit that referenced this pull request Feb 18, 2026
Followup of #1252

Ignore this setting altogether, as logging a warn at each scrape
for a cloud provider specific entry seems a waste of resources.

Signed-off-by: Cristian Greco <cristian@regolo.cc>
sysadmind pushed a commit that referenced this pull request Feb 18, 2026
* fix: ignore setting `google_dataplex.max_messages`

Followup of #1252

Ignore this setting altogether, as logging a warn at each scrape
for a cloud provider specific entry seems a waste of resources.

Signed-off-by: Cristian Greco <cristian@regolo.cc>

* add comment

Signed-off-by: Cristian Greco <cristian@regolo.cc>

---------

Signed-off-by: Cristian Greco <cristian@regolo.cc>
JiriCtvrtka pushed a commit to percona/postgres_exporter that referenced this pull request Feb 26, 2026
…ity#1261)

* fix: ignore setting `google_dataplex.max_messages`

Followup of prometheus-community#1252

Ignore this setting altogether, as logging a warn at each scrape
for a cloud provider specific entry seems a waste of resources.

Signed-off-by: Cristian Greco <cristian@regolo.cc>

* add comment

Signed-off-by: Cristian Greco <cristian@regolo.cc>

---------

Signed-off-by: Cristian Greco <cristian@regolo.cc>
dev-blueMagician added a commit to dev-blueMagician/postgres_exporter that referenced this pull request Mar 3, 2026
* fix: ignore setting `google_dataplex.max_messages`

Followup of prometheus-community/postgres_exporter#1252

Ignore this setting altogether, as logging a warn at each scrape
for a cloud provider specific entry seems a waste of resources.

Signed-off-by: Cristian Greco <cristian@regolo.cc>

* add comment

Signed-off-by: Cristian Greco <cristian@regolo.cc>

---------

Signed-off-by: Cristian Greco <cristian@regolo.cc>
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.

Crash when scraping managed Google Cloud SQL Postgres instance due to google_dataplex.max_messages setting

5 participants