Skip to content

Commit ffddfd9

Browse files
fix: datadog metrics should provide http status code on error if non-2xx response
currently the log line exposes the error, however that's always going to be nil based on the check just above it. This provides better visibility into the failure reason Signed-off-by: Erik Miller <[email protected]>
1 parent 3a27fd1 commit ffddfd9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/metrics/providers/datadog.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ func (p *DatadogProvider) RunQuery(query string) (float64, error) {
131131
}
132132

133133
if r.StatusCode != http.StatusOK {
134-
return 0, fmt.Errorf("error response: %s: %w", string(b), err)
134+
return 0, fmt.Errorf("error response: %s: %s", string(b), r.Status)
135135
}
136136

137137
var res datadogResponse

0 commit comments

Comments
 (0)