Chore: Update prometheus, loki, graphite and influx plugins to support contextual logs. (#57708)

This commit is contained in:
Yuriy Tseretyan
2022-10-27 12:05:06 -04:00
committed by GitHub
parent 9aac0d32f9
commit facf2b1ee8
21 changed files with 149 additions and 142 deletions
+3 -4
View File
@@ -10,7 +10,6 @@ import (
"time"
"github.com/grafana/grafana-plugin-sdk-go/data"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
@@ -50,7 +49,7 @@ func TestFixIntervalFormat(t *testing.T) {
})
}
service := &Service{logger: log.New("tsdb.graphite")}
service := &Service{}
t.Run("Converts response without tags to data frames", func(*testing.T) {
body := `
@@ -69,7 +68,7 @@ func TestFixIntervalFormat(t *testing.T) {
expectedFrames := data.Frames{expectedFrame}
httpResponse := &http.Response{StatusCode: 200, Body: io.NopCloser(strings.NewReader(body))}
dataFrames, err := service.toDataFrames(httpResponse)
dataFrames, err := service.toDataFrames(logger, httpResponse)
require.NoError(t, err)
if !reflect.DeepEqual(expectedFrames, dataFrames) {
@@ -102,7 +101,7 @@ func TestFixIntervalFormat(t *testing.T) {
expectedFrames := data.Frames{expectedFrame}
httpResponse := &http.Response{StatusCode: 200, Body: io.NopCloser(strings.NewReader(body))}
dataFrames, err := service.toDataFrames(httpResponse)
dataFrames, err := service.toDataFrames(logger, httpResponse)
require.NoError(t, err)
if !reflect.DeepEqual(expectedFrames, dataFrames) {