diff --git a/pkg/plugins/datasource/wrapper/datasource_plugin_wrapper.go b/pkg/plugins/datasource/wrapper/datasource_plugin_wrapper.go index 170e187b282..d2cd9f63cde 100644 --- a/pkg/plugins/datasource/wrapper/datasource_plugin_wrapper.go +++ b/pkg/plugins/datasource/wrapper/datasource_plugin_wrapper.go @@ -6,6 +6,7 @@ import ( "fmt" "github.com/grafana/grafana/pkg/components/null" + "github.com/grafana/grafana/pkg/components/simplejson" "github.com/grafana/grafana/pkg/log" "github.com/grafana/grafana/pkg/models" "github.com/grafana/grafana/pkg/tsdb" @@ -79,6 +80,14 @@ func (tw *DatasourcePluginWrapper) Query(ctx context.Context, ds *models.DataSou qr.ErrorString = r.Error } + if r.MetaJson != "" { + metaJson, err := simplejson.NewJson([]byte(r.MetaJson)) + if err != nil { + tw.logger.Error("Error parsing JSON Meta field: " + err.Error()) + } + qr.Meta = metaJson + } + for _, s := range r.GetSeries() { points := tsdb.TimeSeriesPoints{}