Live: Telegraf input modifiers (#32982)

This commit is contained in:
Alexander Emelin
2021-04-19 18:48:43 +03:00
committed by GitHub
parent f92b6518c5
commit d807fbc9e9
10 changed files with 187 additions and 57 deletions
+7 -7
View File
@@ -8,13 +8,6 @@ import (
"sync"
"time"
"github.com/grafana/grafana/pkg/services/live/runstream"
"github.com/centrifugal/centrifuge"
"github.com/grafana/grafana-plugin-sdk-go/backend"
"github.com/grafana/grafana-plugin-sdk-go/data"
"github.com/grafana/grafana-plugin-sdk-go/live"
"github.com/grafana/grafana/pkg/api/dtos"
"github.com/grafana/grafana/pkg/api/response"
"github.com/grafana/grafana/pkg/api/routing"
@@ -25,9 +18,15 @@ import (
"github.com/grafana/grafana/pkg/registry"
"github.com/grafana/grafana/pkg/services/datasources"
"github.com/grafana/grafana/pkg/services/live/features"
"github.com/grafana/grafana/pkg/services/live/runstream"
"github.com/grafana/grafana/pkg/setting"
"github.com/grafana/grafana/pkg/tsdb/cloudwatch"
"github.com/grafana/grafana/pkg/util"
"github.com/centrifugal/centrifuge"
"github.com/grafana/grafana-plugin-sdk-go/backend"
"github.com/grafana/grafana-plugin-sdk-go/data"
"github.com/grafana/grafana-plugin-sdk-go/live"
)
var (
@@ -273,6 +272,7 @@ func (g *GrafanaLive) Init() error {
}
newCtx := centrifuge.SetCredentials(ctx.Req.Context(), cred)
newCtx = setContextSignedUser(newCtx, user)
newCtx = setContextValues(newCtx, ctx.Req.URL.Query())
r := ctx.Req.Request
r = r.WithContext(newCtx) // Set a user ID.