postgres_exporter icon indicating copy to clipboard operation
postgres_exporter copied to clipboard

Getting settings from Azure PG

Open unittolabs opened this issue 3 years ago • 8 comments

What did you do? Try to connect to the Azure-managed PostgreSQL instance.

What did you expect to see? Successful connection and getting metrics.

What did you see instead? Under which circumstances? Go's panic in the logs.

Environment

  • System information: Azure AKS
  • postgres_exporter version: quay.io/prometheuscommunity/postgres-exporter:v0.9.0
  • postgres_exporter flags: --log.level=warn --log.format=logger:stdout?json=true
  • PostgresSQL version: 12.5
  • Logs:
panic: Error converting setting "sync_commit_cancel_wait" value "Disabled" to float: strconv.ParseFloat: parsing "Disabled": invalid syntax

goroutine 25 [running]:
main.(*pgSetting).metric(0xc0002d5bd0, 0xc0001e8210, 0x5, 0x5)
/app/cmd/postgres_exporter/pg_setting.go:80 +0x4d3
main.querySettings(0xc00006b560, 0xc00011a9a0, 0x0, 0x0)
/app/cmd/postgres_exporter/pg_setting.go:49 +0x228
main.(*Server).Scrape(0xc00011a9a0, 0xc00006b560, 0xc00011a900, 0x0, 0x0)
/app/cmd/postgres_exporter/postgres_exporter.go:1030 +0x1a5
main.(*Exporter).scrapeDSN(0xc00011a8f0, 0xc00006b560, 0xc000068230, 0x68, 0x5, 0x1)
/app/cmd/postgres_exporter/postgres_exporter.go:1728 +0x147
main.(*Exporter).scrape(0xc00011a8f0, 0xc00006b560)
/app/cmd/postgres_exporter/postgres_exporter.go:1618 +0x134
main.(*Exporter).Collect(0xc00011a8f0, 0xc00006b560)
/app/cmd/postgres_exporter/postgres_exporter.go:1259 +0x39
github.com/prometheus/client_golang/prometheus.(*Registry).Gather.func1()
/go/pkg/mod/github.com/prometheus/[email protected]/prometheus/registry.go:448 +0x169
created by github.com/prometheus/client_golang/prometheus.(*Registry).Gather
/go/pkg/mod/github.com/prometheus/[email protected]/prometheus/registry.go:538 +0xe8e

unittolabs avatar Apr 21 '21 15:04 unittolabs

Same here. @unitto1 any chance you found a solution for this issue?

dotansimha avatar Jun 24 '21 15:06 dotansimha

Same here. @unitto1 any chance you found a solution for this issue?

unfortunately, nope =(

unittolabs avatar Jun 30 '21 21:06 unittolabs

Same here. @unitto1 any chance you found a solution for this issue?

unfortunately, nope =(

I managed to get some stuff working by adding disableSettingsMetrics (using the Helm chart), it's not complete but I get some metrics reported and not errors.

Seems like Azure returns "Disabled" instead of 0 / 1 or booleans for some configurations.

dotansimha avatar Jul 01 '21 06:07 dotansimha

Same here. @unitto1 any chance you found a solution for this issue?

unfortunately, nope =(

I managed to get some stuff working by adding disableSettingsMetrics (using the Helm chart), it's not complete but I get some metrics reported and not errors.

Seems like Azure returns "Disabled" instead of 0 / 1 or booleans for some configurations.

Yes, this is the reason for failure. Also, Azure restrict this parameter for modification from REPL and from UI

unittolabs avatar Jul 02 '21 07:07 unittolabs

Fix by https://github.com/prometheus-community/postgres_exporter/pull/587

Vampouille avatar Nov 19 '21 17:11 Vampouille

postgres=> SHOW sync_commit_cancel_wait;             
 sync_commit_cancel_wait 
-------------------------
 Disabled
(1 row)

postgres=> SET sync_commit_cancel_wait TO 'Disabled';
ERROR:  invalid value for parameter "sync_commit_cancel_wait": "Disabled"
postgres=> SET sync_commit_cancel_wait TO '666';
SET
postgres=> SHOW sync_commit_cancel_wait;
 sync_commit_cancel_wait 
-------------------------
 Disabled
(1 row)

Vampouille avatar Nov 19 '21 17:11 Vampouille

When will it be released?

argo1984 avatar Apr 25 '22 15:04 argo1984

ETA for release?

fsismondi avatar Jun 29 '22 15:06 fsismondi