diff --git a/pkg/mimir/client/http_client.go b/pkg/mimir/client/http_client.go index 673413ec..ccf341ea 100644 --- a/pkg/mimir/client/http_client.go +++ b/pkg/mimir/client/http_client.go @@ -35,7 +35,7 @@ type Client struct { config *config.MimirConfig } -func NewHttpClient(config *config.MimirConfig) Mimir { +func NewHTTPClient(config *config.MimirConfig) Mimir { return &Client{config: config} } @@ -91,10 +91,10 @@ func (c *Client) doRequest(method string, url string, body []byte) ([]byte, erro if c.config.APIKey != "" { req.SetBasicAuth(c.config.TenantID, c.config.APIKey) } else { - req.Header.Set("X-Scope-OrgID", fmt.Sprintf("%s", c.config.TenantID)) + req.Header.Set("X-Scope-OrgID", c.config.TenantID) } - client, err := createHttpClient() + client, err := createHTTPClient() if err != nil { return nil, err } @@ -116,7 +116,7 @@ func (c *Client) doRequest(method string, url string, body []byte) ([]byte, erro return b, nil } -func createHttpClient() (*http.Client, error) { +func createHTTPClient() (*http.Client, error) { timeout := 10 * time.Second // TODO: Move this configuration to the global configuration if timeoutStr := os.Getenv("GRIZZLY_HTTP_TIMEOUT"); timeoutStr != "" { diff --git a/pkg/mimir/provider.go b/pkg/mimir/provider.go index bf6aaf60..acf7cd67 100644 --- a/pkg/mimir/provider.go +++ b/pkg/mimir/provider.go @@ -9,10 +9,6 @@ import ( "github.com/grafana/grizzly/pkg/mimir/client" ) -const ( - Http string = "http" -) - // Provider is a grizzly.Provider implementation for Grafana. type Provider struct { config *config.MimirConfig @@ -21,7 +17,7 @@ type Provider struct { // NewProvider instantiates a new Provider. func NewProvider(config *config.MimirConfig) (*Provider, error) { - clientTool := client.NewHttpClient(config) + clientTool := client.NewHTTPClient(config) if config.Address == "" { return nil, fmt.Errorf("mimir address is not set") }