Log response body in PostJSONWithTimeout error case (#40509)

<!-- Add the related story/sub-task/bug number, like Resolves #123, or
remove if NA -->
# Checklist for submitter


- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/guides/committing-changes.md#changes-files)
for more information.

## Testing

- [ ] QA'd all new/changed functionality manually
This commit is contained in:
Nico
2026-02-25 15:35:29 -06:00
committed by GitHub
parent b0a0c0cb6f
commit e8152e53fc
15 changed files with 53 additions and 25 deletions
+1 -1
View File
@@ -45,7 +45,7 @@ func (w *webhookLogWriter) Write(ctx context.Context, logs []json.RawMessage) er
"url", server.MaskSecretURLParams(w.url),
)
if err := server.PostJSONWithTimeout(ctx, w.url, payload); err != nil {
if err := server.PostJSONWithTimeout(ctx, w.url, payload, w.logger.SlogLogger()); err != nil {
level.Error(w.logger).Log(
"msg", fmt.Sprintf("failed to send automation webhook to %s", server.MaskSecretURLParams(w.url)),
"err", server.MaskURLError(err).Error(),