Metric request error with PostgreSQL

Hello everybody
I constantly get the error message “Metric request error” and can not connect to the PostgresSQL database. Can anybody help me further?

1 Like

Using 6.1.6 Grafana + PostGre.

I noticed, that if you leave “Host” parameter as default (untouched) -> even the default is correct, it will cry this “Metric error”. If you type something in or touch, so it comes “white” -> No Metric error.

Anyone else can reproduce this?

I can’t seem to reproduce that behavior. Has there been any resolution on this issue?

Any solution for this?

I reproduced this defect on Grafana * v7.0.3 (00ee734baf)

1 Like

Try removing the database name from the host name. The host is expected to be the IP address/hostname and optional port of your PostgreSQL instance

If it contains the database name as well, then the connection string for connecting to the postgres will not be correct. Here it is how it is built:

Thanks @dianapayton! as you suggested, I used the url configuration instead of the host. Datasource provisioning succeeded! :heart_eyes:

2 Likes

hi Vladsanchez, how can you fix that ? Could you pls give me more details ?

hi, @vladsanchez , could you please help ?

try removing protocol http:// from the host. it worked for me.

can you please explain how you did it.

I’ve the same issue with Grafana 8.1.2.

I don’t have the database name after the hostname.

I tried removing http:// in front of the hostname.

Any more suggestions?

Regards,
Stefan

Solved by removing http:// after configuring the postgresql configuration in Home Assistant for PostgreSQL database port, expose this if you need to access outside of Home Assistant

This did not work for me. I removed the http:// before the host name and I’m still getting the following error “Metric request error”. See screenshot below:

In my case problem was in the space in the password. Unbelievable but true.