Reputation: 62563
I am doing a fresh grafana install. I am trying to add PSQL data source to it, and going through Data Sources / PostgreSQL. I have provided host (localhost), database, user and password, and I know that database is up and running because I can connect with psql
command.
However, when I click Save & Test
, I am presented with a big red banner which reads Metric request error
.
Grafana log tells me that
EROR[03-26|14:49:31] Metric request error
logger=context userId=1 orgId=1 uname=admin error="dbname is empty"EROR[03-26|14:49:31] Request Completed
logger=context userId=1 orgId=1 uname=admin method=POST path=/api/tsdb/query status=500 remote_addr=[::1] time_ms=12 size=34 referer=http://localhost:3000/datasources/edit/1/
Which is not very helpful. I can post a screenshot if one thinks it can be useful. How do I troubleshoot it? Which direction should I look?
Here is a screenshot of UI:
Upvotes: 3
Views: 3540
Reputation:
You must explicitly set the Host url, the faded text value of "localhost:5432" is not actually being used by Grafana.. This is unintuitive since the other four faded values are fine to leave as they are!
Upvotes: 12
Reputation: 28626
error="dbname is empty"
Probably you didn't specify DB name datasource configuration in the UI properly. Screenshot of datasource configuration will be useful here.
Upvotes: -1