Skip to content

Getting settings from Azure PG #523

New issue

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

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

Already on GitHub? # to your account

Open
unittolabs opened this issue Apr 21, 2021 · 8 comments
Open

Getting settings from Azure PG #523

unittolabs opened this issue Apr 21, 2021 · 8 comments

Comments

@unittolabs
Copy link

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/client_golang@v1.9.0/prometheus/registry.go:448 +0x169
created by github.com/prometheus/client_golang/prometheus.(*Registry).Gather
/go/pkg/mod/github.com/prometheus/client_golang@v1.9.0/prometheus/registry.go:538 +0xe8e
@dotansimha
Copy link

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

@unittolabs
Copy link
Author

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

unfortunately, nope =(

@dotansimha
Copy link

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.

@unittolabs
Copy link
Author

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

@Vampouille
Copy link

Fix by #587

@Vampouille
Copy link

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)

@argo1984
Copy link

When will it be released?

@fsismondi
Copy link

ETA for release?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants