Cloudwatch: Remove core imports from infra/log (#81543)

* Cloudwatch: use logging from plugin-sdk-go instead of infra/log
* Add a link to the TODO issue for moving `instrumentContext`
This commit is contained in:
Nathan Vērzemnieks
2024-02-07 13:53:05 +01:00
committed by GitHub
parent c16cb7ed3c
commit b5f26560c2
28 changed files with 211 additions and 172 deletions
@@ -9,6 +9,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/grafana/grafana-plugin-sdk-go/backend/log"
"github.com/grafana/grafana/pkg/tsdb/cloudwatch/models"
)
@@ -26,13 +27,13 @@ func TestMetricDataInputBuilder(t *testing.T) {
for _, tc := range tests {
t.Run(tc.name, func(t *testing.T) {
executor := newExecutor(nil, &fakeSessionCache{})
executor := newExecutor(nil, &fakeSessionCache{}, log.NewNullLogger())
query := getBaseQuery()
query.TimezoneUTCOffset = tc.timezoneUTCOffset
from := now.Add(time.Hour * -2)
to := now.Add(time.Hour * -1)
mdi, err := executor.buildMetricDataInput(logger, from, to, []*models.CloudWatchQuery{query})
mdi, err := executor.buildMetricDataInput(from, to, []*models.CloudWatchQuery{query})
assert.NoError(t, err)
require.NotNil(t, mdi)