So I’m trying to develop a plugin that will talk to an api this api will give me some string values for a certain server and I just want to append a time to it and a value of 1.
I followed the datasource plugin tutorial and als the .fetch explanation. I’ve tried looking into other datasources as well but can’t seem to find any major differences in the user of backendsrv.
However I seem to get a mixed content warning error
Mixed Content: The page at 'grafana.example.com' was loaded over HTTPS, but requested an insecure resource 'http://puppetdb:9090/pdb/query/v4/facts'. This request has been blocked; the content must be served over HTTPS.
So it does seem the request is working but I think it is not going trough the backend.
I also use the prometheus plugin and that also works via http internally. So it is weird. Am I missing something?
Requests are always sent via the browser. The Grafana webpage requests data from the backend like any other website would request data from an HTTP server.
but then how do other plugins like prometheus,… do it? They do work via http as they use the backend.
The documentation of backenSrv also mentions http.
The Prometheus plugin is also a datasource plugin, which integrates into the backend. It “teaches” the backend how to talk to Prometheus. The communication always happens like this:
Ok so how do I do that. I know the prometheus extends from a different class. My plugin is also a datasource plugin. I’ve also tested this one and used the backendsrv.fetch inside. As they also do inside there plugin. But requests seems to happen via the browser. How do I tech my plugin to use the backend.
Thank you for the link. It does seem to be a different approuch than the current datasource-plugin tutorial I was following. I’ll try this method and hopefully get it working.