Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: log if an error is returned from upstream #16387

Closed
wants to merge 1 commit into from

Conversation

btasker
Copy link
Contributor

@btasker btasker commented Jan 9, 2025

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 with invalid) 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:

2025-01-09T12:18:27Z W! [outputs.influxdb_v2] failed to write metric to testingdb (will be dropped: 400 Bad Request)
2025-01-09T12:18:27Z D! [outputs.influxdb_v2] Wrote batch of 13 metrics in 3.996059ms

Checklist

  • No AI generated code was used in this PR

Related issues

resolves #

@telegraf-tiger telegraf-tiger bot added the fix pr to fix corresponding bug label Jan 9, 2025
@Hipska
Copy link
Contributor

Hipska commented Jan 16, 2025

This seems already be fixed by #16388?

@btasker
Copy link
Contributor Author

btasker commented Jan 16, 2025

Yep, Sven and I were talking in the background and I forgot to come back and close this out

@btasker btasker closed this Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix pr to fix corresponding bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants