Grafana v10.2.3 with postgres datasource

  • What Grafana version and what operating system are you using?

Grafana v10.2.3. Deployed as an app service using docker

  • What are you trying to achieve?
    I am trying to create postgres data source. I have given host url, database name, user and password. After clicking Save and Test, getting error “[sqleng.connectionError] failed to connect to server - please inspect Grafana server log for details”. and in the logs, I see this

logger=tsdb.postgres t=2024-02-29T05:06:00.51831736Z level=error msg=“Check health failed” error=“dial tcp :5432: connect: connection timed out”
2024-02-29T05:06:00.520789906Z: [INFO] logger=tsdb.postgres t=2024-02-29T05:06:00.518877293Z level=error msg=“Query error” err=“dial tcp :5432: connect: connection timed out”

  • How are you trying to achieve it?

  • What happened?

  • What did you expect to happen?

Database connection is Ok

  • Can you copy/paste the configuration(s) that you are having problems with?

  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.

  • Did you follow any online instructions? If so, what is the URL?

Can someone please help me with this ?

Thanks
hareesh

1 Like

Hi @ahareesh have you figured out a solution for this problem? I have a very similar issue where I am experiencing the same behavior and error. Please and thank you

Is your Grafana in a docker? If so, you need to do this: host.docker.internal:5432

1 Like