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 <erik.miller@gusto.com>
This commit is contained in:
Erik Miller
2025-11-13 12:59:08 -08:00
parent 3a27fd147f
commit ffddfd9c24
+1 -1
View File
@@ -131,7 +131,7 @@ func (p *DatadogProvider) RunQuery(query string) (float64, error) {
}
if r.StatusCode != http.StatusOK {
return 0, fmt.Errorf("error response: %s: %w", string(b), err)
return 0, fmt.Errorf("error response: %s: %s", string(b), r.Status)
}
var res datadogResponse