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 contradictory debug messages in influxdb output #11942

Open
reimda opened this issue Oct 4, 2022 · 1 comment
Open

Fix contradictory debug messages in influxdb output #11942

reimda opened this issue Oct 4, 2022 · 1 comment
Assignees
Labels
area/influxdb bug unexpected problem or unintended behavior

Comments

@reimda
Copy link
Contributor

reimda commented Oct 4, 2022

When telegraf is configured to print debug level errors and the influxdb output is begin used, if there is a server error (or any HTTP 4xx response), telegraf prints two debug messages that contradict each other:

2022-10-04T22:20:23Z E! [outputs.influxdb] E! [outputs.influxdb] Failed to write metric (will be dropped: 401 Unauthorized):
2022-10-04T22:20:23Z D! [outputs.influxdb] Wrote batch of 15 metrics in 6.440209ms

The first one says metrics were dropped, the second says they were written.

Since the RunningOutput only prints the "Wrote batch" message when there's no error, maybe the output shouldn't return nil here

and maybe it should return an APIError like it does for other cases:

return &APIError{

@reimda
Copy link
Contributor Author

reimda commented Oct 5, 2022

I'm working on a PR for this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/influxdb bug unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants