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: Add error message logging to outputs.http #9727

Merged

Conversation

gouthamve
Copy link
Contributor

@gouthamve gouthamve commented Sep 6, 2021

We run a multitenant system with 1000s of users and some of them use
Telegraf to push to us. The error logs they see look like this:

2021-09-06T06:07:34Z E! [agent] Error writing to outputs.http:
when writing to [XXX] received status code: 400
2021-09-06T06:07:34Z D! [outputs.http] Buffer fullness: 2410 / 200000
metrics
2021-09-06T06:07:34Z E! [agent] Error writing to outputs.http: when
writing to [XXX] received status code: 400
2021-09-06T06:07:44Z D! [outputs.http] Buffer fullness: 2415 / 200000
metrics
2021-09-06T06:07:44Z E! [agent] Error writing to outputs.http: when
writing to [XXXX] received status code: 400

Our upstream returns actionable messages that make the issue pretty
clear to our users, but those using Telegraf cannot see those messages.
I propose that users should be able to see the error message returned
from upstream.

We're seeing more and more of our users adopting Telegraf and its an
awesome project! This is not the first time our users contacted
regarding this issue and I think this enhancement will be useful to
wider community as well!

This particular piece of code has been inspired by how Prometheus remote
write does the error logging.

Signed-off-by: Goutham Veeramachaneni gouthamve@gmail.com

Required for all PRs:

  • Updated associated README.md.
  • Wrote appropriate unit tests.
  • Pull request title or commits are in conventional commit format (e.g. feat: or fix:)

resolves #

We run a multitenant system with 1000s of users and some of them use
Telegraf to push to us. The error logs they see look like this:

```
2021-09-06T06:07:34Z E! [agent] Error writing to outputs.http:
when writing to
[XXX]
received status code: 400
2021-09-06T06:07:34Z D! [outputs.http] Buffer fullness: 2410 / 200000
metrics
2021-09-06T06:07:34Z E! [agent] Error writing to outputs.http: when
writing to
[XXX]
received status code: 400
2021-09-06T06:07:44Z D! [outputs.http] Buffer fullness: 2415 / 200000
metrics
2021-09-06T06:07:44Z E! [agent] Error writing to outputs.http: when
writing to
[XXXX]
received status code: 400
```

Our upstream returns actionable messages that make the issue pretty
clear to our users, but those using Telegraf cannot see those messages.
I propose that users should be able to see the error message returned
from upstream.

We're seeing more and more of our users adopting Telegraf and its an
awesome project! This is not the first time our users contacted
regarding this issue and I think this enhancement will be useful to
wider community as well!

This particular piece of code has been inspired by how Prometheus remote
write does the error logging.

Signed-off-by: Goutham Veeramachaneni <gouthamve@gmail.com>
@telegraf-tiger telegraf-tiger bot added the feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin label Sep 6, 2021
@sspaink sspaink added fix pr to fix corresponding bug feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin and removed feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin labels Sep 13, 2021
@sspaink sspaink removed the feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin label Sep 13, 2021
Copy link
Contributor

@sspaink sspaink left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding more logging info sounds like a good idea to me! Thanks for this pr.

@sspaink sspaink added the ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. label Sep 13, 2021
@gouthamve
Copy link
Contributor Author

Thanks for the review @sspaink! Is there anything else I need to do to get this merged?

Copy link
Member

@helenosheaa helenosheaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thanks for the PR!

@helenosheaa helenosheaa merged commit 357959f into influxdata:master Sep 14, 2021
reimda pushed a commit that referenced this pull request Sep 17, 2021
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 ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants