Is this possible to build a backend plugin that send front and back HTTP requests?

@academo,

Here is the result with my development elastic endpoint :

(This is the same result for the qualification elastic endpoint)

With thejsonplaceholder (-k for SSL) :
curl_external_api

So it works.

Whith the proxy URL :

+verbose :

PS : I noticed with a -verbose in my elastic URL that it uses the HTTPS_PROXY env variable which is my company proxy. Is it a problem ?

The curl to the grafana proxy won’t really work because you need cookies and some headers for it to work, but the fact that the jsonplaceholder api returns data and your internal elastic returns 502 means that the problem is in your elastic endpoint and not the grafana proxy.

Once you manage to make curl work with your elastic endpoint you can be sure it is not a problem of the container accessing the resources.

Grafana should pick up the HTTPS_PROXY without problem and use it if it is defined.

@academo I used --noproxy and it worked better !

When I exec with --noproxy, -h and -k I have a 401 !!! :

Maybe my company proxy block something.

1 Like

There you go! the problem seems to be in your proxy configuration. Wish you success moving forward with your plugin development!

1 Like

Hello @academo,

Thank you.

I have one last question. My plugin has a backend part in Golang.
How to use the datasource.go file instead of the datasource.ts file ?
Is there a setting where I can do it ? My plugin looks like this one : datasource-http-backend. In which file can I switch from TS to GO ?

Have a nice day

Hi @maximedousselaere there’s no such a thing as a datasource.go file and you still need a datasource.ts file even if your datasource is a backend datasource.

Take a look at our guide to create a datasource backend plugin specially in the anatomy of a plugin section

1 Like

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