Hi, I have working datasource-plugin and panel plugins frot Grafana 7.X
In a panel plugin I want to have say a button “Make specific request”, and I want this request to be done from datasource. How can I invoke it from the panel? Can I add some custom callback to my panel or shoud it be done through some events subscription? Looks like location variables are not the option. Thanks
Is it legal?
/*From the Panel Plugin */
import { getDataSourceSrv } from '@grafana/runtime';
...
const myDatasource = getDataSourceSrv();
myDatasource.get("myDSName")
.then(dataSourceInstance => dataSourceInstance.makeSpecificRequest("specificParams"))
Hello. Did you get a solution to this? I’m new to Grafana and I’m looking for a similar functionality.
I have to make a request (GET/PUT/POST) from the panel but through the datasource plugin since that has the authentication.
Please let me know if there’s a way to do this.
Consider adding a resource handler to your data source. This essentially extends the Grafana REST API with a custom route for your data source that will be available to any panel.