fix: log if an error is returned from upstream #16387
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Raising to try and address #16386
Because of the partial writes handling, the influxdb_v2 output plugin doesn't complain if it receives a 400. This can mask configuration issues and make it look like data is being written when it isn't.
This PR adjusts the handling to ensure that a
400
matches the partial writes behaviour (i.e. includes a message which begins withinvalid
) and generates a logline if that's not the case.Note: it doesn't change behaviour beyond that - we likely still want the metrics to be discarded so they don't block the buffer. But, this also means that, as written, Telegraf will print both a failure and a success message:
Checklist
Related issues
resolves #