Adding psql data source to fresh Grafana installIs it possible to duplicate a dashboard in grafana?Grafana with elasticsearch data sourceInstalling Grafana Panel PluginHow to install grafana-cli and grafana pluginGrafana with MongoDB as data sourceGrafana custom data sourceIssue with sending mails from grafanaRemove and fresh install of grafana packageGrafana simple json data source example
May a man marry the women with whom he committed adultery?
How to store my pliers and wire cutters on my desk?
How to apply the changes to my `.zshrc` file after edit?
Is a topological space considered to be a class in set theory?
How do I stop my characters falling in love?
Trapped in an ocean Temple in Minecraft?
How could Nomadic scholars effectively memorize libraries worth of information
Isolated audio without a transformer
Are there any examples of technologies have been lost over time?
Polyhedra, Polyhedron, Polytopes and Polygon
Where to find an interactive PDF or HTML version of the tex.web documentation?
Is it legal for private citizens to "impound" e-scooters?
Is my employer paying me fairly? Going from 1099 to W2
Japanese reading of an integer
What does "see" in "the Holy See" mean?
How to handle academic references for US PhD program, when I have been out of academia for a (very) long time?
The Sword in the Stone
Vertical tennis ball into fancy new enumerate
Why isn't there a ";" after "do" in sh loops?
Suggestions for protecting jeans from saddle clamp bolt
Leaf-Spine network without routing
How can I say in Russian "they cannot make the tournament attractive by itself"?
Are USB protocol and connector free or are they patented?
Converting 8V AC to 8V DC - bridge rectifier gets very hot while idling
Adding psql data source to fresh Grafana install
Is it possible to duplicate a dashboard in grafana?Grafana with elasticsearch data sourceInstalling Grafana Panel PluginHow to install grafana-cli and grafana pluginGrafana with MongoDB as data sourceGrafana custom data sourceIssue with sending mails from grafanaRemove and fresh install of grafana packageGrafana simple json data source example
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
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:

grafana
add a comment |
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:

grafana
For the record, I was able to add the source successfully using yaml-based provisioning. Still curious why UI method failed.
– SergeyA
Mar 26 at 19:25
add a comment |
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:

grafana
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:

grafana
grafana
edited Mar 26 at 20:33
SergeyA
asked Mar 26 at 18:50
SergeyASergeyA
47.8k5 gold badges45 silver badges96 bronze badges
47.8k5 gold badges45 silver badges96 bronze badges
For the record, I was able to add the source successfully using yaml-based provisioning. Still curious why UI method failed.
– SergeyA
Mar 26 at 19:25
add a comment |
For the record, I was able to add the source successfully using yaml-based provisioning. Still curious why UI method failed.
– SergeyA
Mar 26 at 19:25
For the record, I was able to add the source successfully using yaml-based provisioning. Still curious why UI method failed.
– SergeyA
Mar 26 at 19:25
For the record, I was able to add the source successfully using yaml-based provisioning. Still curious why UI method failed.
– SergeyA
Mar 26 at 19:25
add a comment |
2 Answers
2
active
oldest
votes
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!
add a comment |
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.
Screenshot added, looks like database is still there?
– SergeyA
Mar 26 at 20:34
@SergeyA Are you able to runSELECT 1(SQL for datasource testing) with used credentials? Used test SQL query can be a problem for your DB.
– Jan Garaj
Mar 27 at 4:41
Yes, when I used PSQL outside of Grafana with given creds it all worked well.
– SergeyA
Mar 27 at 13:47
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55364356%2fadding-psql-data-source-to-fresh-grafana-install%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
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!
add a comment |
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!
add a comment |
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!
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!
answered May 23 at 12:31
jphjph
465 bronze badges
465 bronze badges
add a comment |
add a comment |
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.
Screenshot added, looks like database is still there?
– SergeyA
Mar 26 at 20:34
@SergeyA Are you able to runSELECT 1(SQL for datasource testing) with used credentials? Used test SQL query can be a problem for your DB.
– Jan Garaj
Mar 27 at 4:41
Yes, when I used PSQL outside of Grafana with given creds it all worked well.
– SergeyA
Mar 27 at 13:47
add a comment |
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.
Screenshot added, looks like database is still there?
– SergeyA
Mar 26 at 20:34
@SergeyA Are you able to runSELECT 1(SQL for datasource testing) with used credentials? Used test SQL query can be a problem for your DB.
– Jan Garaj
Mar 27 at 4:41
Yes, when I used PSQL outside of Grafana with given creds it all worked well.
– SergeyA
Mar 27 at 13:47
add a comment |
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.
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.
answered Mar 26 at 19:30
Jan GarajJan Garaj
5,7378 silver badges27 bronze badges
5,7378 silver badges27 bronze badges
Screenshot added, looks like database is still there?
– SergeyA
Mar 26 at 20:34
@SergeyA Are you able to runSELECT 1(SQL for datasource testing) with used credentials? Used test SQL query can be a problem for your DB.
– Jan Garaj
Mar 27 at 4:41
Yes, when I used PSQL outside of Grafana with given creds it all worked well.
– SergeyA
Mar 27 at 13:47
add a comment |
Screenshot added, looks like database is still there?
– SergeyA
Mar 26 at 20:34
@SergeyA Are you able to runSELECT 1(SQL for datasource testing) with used credentials? Used test SQL query can be a problem for your DB.
– Jan Garaj
Mar 27 at 4:41
Yes, when I used PSQL outside of Grafana with given creds it all worked well.
– SergeyA
Mar 27 at 13:47
Screenshot added, looks like database is still there?
– SergeyA
Mar 26 at 20:34
Screenshot added, looks like database is still there?
– SergeyA
Mar 26 at 20:34
@SergeyA Are you able to run
SELECT 1 (SQL for datasource testing) with used credentials? Used test SQL query can be a problem for your DB.– Jan Garaj
Mar 27 at 4:41
@SergeyA Are you able to run
SELECT 1 (SQL for datasource testing) with used credentials? Used test SQL query can be a problem for your DB.– Jan Garaj
Mar 27 at 4:41
Yes, when I used PSQL outside of Grafana with given creds it all worked well.
– SergeyA
Mar 27 at 13:47
Yes, when I used PSQL outside of Grafana with given creds it all worked well.
– SergeyA
Mar 27 at 13:47
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55364356%2fadding-psql-data-source-to-fresh-grafana-install%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
For the record, I was able to add the source successfully using yaml-based provisioning. Still curious why UI method failed.
– SergeyA
Mar 26 at 19:25