in pkg/main.go [25:38]
func main() {
// Start listening to requests sent from Grafana. This call is blocking so
// it won't finish until Grafana shuts down the process or the plugin choose
// to exit by itself using os.Exit. Manage automatically manages life cycle
// of datasource instances. It accepts datasource instance factory as first
// argument. This factory will be automatically called on incoming request
// from Grafana to create different instances of SampleDatasource (per datasource
// ID). When datasource configuration changed Dispose method will be called and
// new datasource instance created using NewSampleDatasource factory.
if err := datasource.Manage("googlecloud-trace-datasource", plugin.NewCloudTraceDatasource, datasource.ManageOpts{}); err != nil {
log.DefaultLogger.Error("error running", "error", err.Error())
os.Exit(1)
}
}