Skip to content

fix: correct error messages in NewRelic, Dynatrace, and Stackdriver providers - #1986

Open
okarin1511 wants to merge 1 commit into
fluxcd:mainfrom
okarin1511:fix/metrics-provider-error-messages
Open

okarin1511 wants to merge 1 commit into
fluxcd:mainfrom
okarin1511:fix/metrics-provider-error-messages

Conversation

@okarin1511

Copy link
Copy Markdown

Fixes #1985

Summary

  • NewRelic: RunQuery wraps a nil err with %w on non-200 responses (the err variable holds the result of a successful io.ReadAll, not the HTTP error). Changed to format r.Status instead.
  • Dynatrace: Same copy-paste bug, same fix.
  • Stackdriver: RunQuery constructs a detailed gRPC error string (errStr) with status message and details, then formats the original err instead. Changed to use errStr in the gRPC status branch.

Test plan

  • All existing NewRelic, Dynatrace, and Stackdriver tests pass
  • Changes are minimal and self-evident (formatting the correct variable)

…roviders

NewRelic and Dynatrace providers wrap a nil error with %w on non-200
responses. At that point err is nil (from the successful io.ReadAll
call), producing messages like "error response: <body>: <nil>".
Changed to format the HTTP status instead.

Stackdriver provider builds a detailed gRPC error string with status
details but then formats the original error instead of the constructed
string. Changed to use errStr in the gRPC status branch.

Signed-off-by: Aseem Khandekar <69676297+okarin1511@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NewRelic, Dynatrace, and Stackdriver providers produce misleading error messages

1 participant