mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
add core plugins thru store (#43085)
This commit is contained in:
@@ -22,7 +22,7 @@ import (
|
||||
|
||||
const (
|
||||
timeSeries = "time_series"
|
||||
dsName = "grafana-azure-monitor-datasource"
|
||||
pluginID = "grafana-azure-monitor-datasource"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -30,7 +30,7 @@ var (
|
||||
legendKeyFormat = regexp.MustCompile(`\{\{\s*(.+?)\s*\}\}`)
|
||||
)
|
||||
|
||||
func ProvideService(cfg *setting.Cfg, httpClientProvider *httpclient.Provider, registrar plugins.CoreBackendRegistrar) *Service {
|
||||
func ProvideService(cfg *setting.Cfg, httpClientProvider *httpclient.Provider, pluginStore plugins.Store) *Service {
|
||||
proxy := &httpServiceProxy{}
|
||||
executors := map[string]azDatasourceExecutor{
|
||||
azureMonitor: &AzureMonitorDatasource{proxy: proxy},
|
||||
@@ -55,7 +55,8 @@ func ProvideService(cfg *setting.Cfg, httpClientProvider *httpclient.Provider, r
|
||||
CallResourceHandler: httpadapter.New(resourceMux),
|
||||
})
|
||||
|
||||
if err := registrar.LoadAndRegister(dsName, factory); err != nil {
|
||||
resolver := plugins.CoreDataSourcePathResolver(cfg, pluginID)
|
||||
if err := pluginStore.AddWithFactory(context.Background(), pluginID, factory, resolver); err != nil {
|
||||
azlog.Error("Failed to register plugin", "error", err)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user