Skip to content

Commit c74c8d2

Browse files
committed
Add new log message with key length
1 parent c17ea6c commit c74c8d2

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

internal/metrics/api.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ func (cl *APIClient) SendMetrics(metrics []APIMetric) error {
9595
defer resp.Body.Close()
9696

9797
if resp.StatusCode < 200 || resp.StatusCode > 299 {
98+
if resp.StatusCode == 403 {
99+
logger.Debug(fmt.Sprintf("authorization failed with api key of length %d characters", len(cl.apiKey)))
100+
}
98101
bodyBytes, err := ioutil.ReadAll(resp.Body)
99102
body := ""
100103
if err == nil {

0 commit comments

Comments
 (0)