Prometheus: (Chore) Switch from infra to sdk logger (#76827)

This commit is contained in:
Kyle Brandt
2023-10-20 08:54:27 -05:00
committed by GitHub
parent 7759e2f8a3
commit 6dea3102cb
14 changed files with 37 additions and 38 deletions
@@ -4,10 +4,9 @@ import (
"net/http"
"testing"
"github.com/grafana/grafana-plugin-sdk-go/backend"
"github.com/grafana/grafana-plugin-sdk-go/backend/httpclient"
"github.com/stretchr/testify/require"
"github.com/grafana/grafana/pkg/infra/log"
)
func TestEnsureHttpMethodMiddleware(t *testing.T) {
@@ -15,7 +14,7 @@ func TestEnsureHttpMethodMiddleware(t *testing.T) {
finalRoundTripper := httpclient.RoundTripperFunc(func(req *http.Request) (*http.Response, error) {
return &http.Response{StatusCode: http.StatusOK}, nil
})
mw := ForceHttpGet(log.New("test"))
mw := ForceHttpGet(backend.NewLoggerWith("logger", "test"))
rt := mw.CreateMiddleware(httpclient.Options{}, finalRoundTripper)
require.NotNil(t, rt)
middlewareName, ok := mw.(httpclient.MiddlewareName)
@@ -28,7 +27,7 @@ func TestEnsureHttpMethodMiddleware(t *testing.T) {
return &http.Response{StatusCode: http.StatusOK}, nil
})
mw := ForceHttpGet(log.New("test"))
mw := ForceHttpGet(backend.NewLoggerWith("logger", "test"))
rt := mw.CreateMiddleware(httpclient.Options{}, finalRoundTripper)
require.NotNil(t, rt)