mirror of
https://github.com/grafana/grafana.git
synced 2025-09-28 20:13:53 +08:00
Backend Plugins: Provide proper plugin config to plugins (#21985)
Properly provides plugin configs to backend plugins. Uses v0.16.0 of grafana-plugin-sdk-go- Ref #21512 Ref #19667
This commit is contained in:

committed by
GitHub

parent
f82a6aa0d0
commit
9d7c74ef91
@ -55,7 +55,7 @@ func (p *TransformPlugin) onPluginStart(pluginID string, client *backendplugin.C
|
||||
|
||||
if client.DatasourcePlugin != nil {
|
||||
tsdb.RegisterTsdbQueryEndpoint(pluginID, func(dsInfo *models.DataSource) (tsdb.TsdbQueryEndpoint, error) {
|
||||
return wrapper.NewDatasourcePluginWrapperV2(logger, client.DatasourcePlugin), nil
|
||||
return wrapper.NewDatasourcePluginWrapperV2(logger, p.Id, p.Type, client.DatasourcePlugin), nil
|
||||
})
|
||||
}
|
||||
|
||||
@ -122,9 +122,15 @@ func (s *transformCallback) DataQuery(ctx context.Context, req *pluginv2.DataQue
|
||||
return nil, fmt.Errorf("zero queries found in datasource request")
|
||||
}
|
||||
|
||||
datasourceID := int64(0)
|
||||
|
||||
if req.Config.DatasourceConfig != nil {
|
||||
datasourceID = req.Config.DatasourceConfig.Id
|
||||
}
|
||||
|
||||
getDsInfo := &models.GetDataSourceByIdQuery{
|
||||
Id: req.Config.Id,
|
||||
OrgId: req.Config.OrgId,
|
||||
Id: datasourceID,
|
||||
}
|
||||
|
||||
if err := bus.Dispatch(getDsInfo); err != nil {
|
||||
|
Reference in New Issue
Block a user