simPod / GrafanaJsonDatasource

Grafana datasource to load JSON data over your arbitrary HTTP backend
https://grafana.com/grafana/plugins/simpod-json-datasource/
MIT License
355 stars 72 forks source link

Failed to fetch #160

Closed tiagoFonseca1109 closed 3 years ago

tiagoFonseca1109 commented 3 years ago

Hello,

I´m trying to use this plugin to connect to an ASP.NET backend. I´ve implemented an endpoint returning code 200 and tested it in Postman, the image below:

image

Although, when I try to connect this plugin, it keeps giving the error message "Failed to fetch" as in the image below:

image

I´ve searched in the documentation, but I did not see this error anywhere, and for so, I am asking here.

I really appreciate any help you can provide.

simPod commented 3 years ago

Try to set Access as Client so the request is not proxied through Grafana backend and you can debug it e.g. in browser dev tools Network tab

tiagoFonseca1109 commented 3 years ago

image

Thanks for such a quick response. When I open the referred tab, it says this

I've tried it in EDGE too

tiagoFonseca1109 commented 3 years ago

Update: “Failed to fetch:net::ERR_CERT_AUTHORITY_INVALID.” is the message when hovering the "failed"

simPod commented 3 years ago

I guess there's issue with certificate on your backend though it's not related to this datasource.

tiagoFonseca1109 commented 3 years ago

https://github.com/grafana/grafana/issues/19842

Is there a way to ignore HTTP errors as they did to resolve the same issue in this other plugin ?

simPod commented 3 years ago

No, that's out of scope of this plugin. It has no control over it, is leverages Grafana's http config component https://github.com/simPod/GrafanaJsonDatasource/blob/73cb14e624b8c7cb676ef2fc3ca4751e48368510/src/ConfigEditor.tsx#L2

tiagoFonseca1109 commented 3 years ago

Hello,

I fixed the issue by disabling the HTTP feature of my app. Even though I made the request to HTTP, for some reason the endpoint was changed to the HTTPS version.

Just another quick question. In the documentation, there is an example wherein the query endpoint exist two targets

My question is: How can I, in the response json of my API, identify each one, for let's say to graphs in the same dashboard don't get duplicated data

simPod commented 3 years ago

Hm, can you rephrase your question? Not sure I understand what you're asking. Why would graphs get duplicated data?

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.