Postgres app and Grafana app - How do I add the postgres app as data source to Grafana?

Hey,

I have set up two apps (example names):

database_app → Postgres database
grafana_app → Grafana

I have enabled timescale on the postgres database and now I want to add it to my Grafana instance as data source. However, I am unsure what the “host” is for the connection.


I tried the database-app.internal link that it generated when I created the database app but that results in the error:

failed to connect to server - please inspect Grafana server log for details

The server logs only tell me: “no such host”


Then, I have tried the connection url, which is something like postgres://postgres:PASSWORD@database-app.flycast:5432.

This results in the error

Plugin health check failed

The logs tell me: “failed to check health: invalid port in host specifier”


I’d appreciate any help with this. What is the host for the database app? I assumed it’s some kind of internal url, since both apps are in the same organization.

Thanks!

I found the answer.

It’s database-app.flycast:5432

You can find this under “Hostname” in the “Overview” page of the app, in your fly.io Dashboard. Just remove the “postgresql://” in the beginning and add the :5432 port at the end. Now the connection works :slight_smile:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.