I’m new to Grafana plugin development (and angular) and I’m having trouble with my app type plugin.
I would want to call a function of my custom data source plugin from my app plugin page (not panel). I’ve found the data source by going through
datasourceSrv.getAll()
but that doesn’t return the actual object to call. How can I access the instance of the datasource controller to call the controller function?
Hi, I am totally new to grafana and I am trying the same thing i.e. to connect to my backend api through grafana so that I can display data my data from mysql db into a table format on a page not on a panel. As I am new to grafana, I didn’t understand the code you have posted above. Can you please elaborate on it more. Also I am familiar with recent versions of angular e.g. angular 4 and 5, where it is quite easy to just call backend api using httpmodule. But I cannot see that is the case with grafana. I cannot call backend api directly as I face CORS issue then. In angular 2 or angular 4 I know how to go through the proxy and solve this issue, but is there any similar way for grafana too. I would appreciate your help as I am stuck here for quite a while now. For some more background let me tell you that I am using my own grafana plugin which has couple of pages included in it. Now I want to display a table in one of them, but for that I want to connect to my backend. So how can I do that? How in grafana do we do that? My backend server is running on 8080 port while I am running grafana on 8090. Thanks
To not get cors errors, you should use server mode to go through the Grafana proxy. That is set on the config page for your mysql data source. Then you make calls to it like this (the url variable is taken from the config page - instanceSettings.url):
Hi all,
I am new in grafana . I want to create a plugin which will take data from our own api , and we want to show them on grafana panel . How can I do that ?
@daniellee thank you a lot, your example with api/datasources/ helped me to get URL and username. I just wondering if there is a way to get all connection info. I’m developing a panel for ML. So when user creates a ML model panel sends a request to Loud ML server with info about source data to train model on.
Hope you have this package in your package.json. Please check.
From my side - I also getting a lot of similar errors in terminal.
It looks this is a linter, as a code got compiled and I see this is Grafana - features I’m adding appear
and is useful.