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

Add callback for error handling when using async #97

Merged
merged 2 commits into from Sep 26, 2021

Conversation

ivan-valkov
Copy link
Contributor

This PR adds an optional callback that can be called when a message is sent when using async. The callback can be used to pass errors to the caller so that they can decide what to do with the dropped message. It can also be used for monitoring by adding metrics in the callback, like a simple prometheus counter that counts successful vs failed logs.

Related to #80

Signed-off-by: ivan-valkov <iv.v.valkov@gmail.com>
Copy link
Member

@tagomoris tagomoris left a comment

Choose a reason for hiding this comment

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

LGTM.
Could you add a section about the new option AsyncResultCallback to README?

@ivan-valkov
Copy link
Contributor Author

LGTM.
Could you add a section about the new option AsyncResultCallback to README?

Thanks for the quick review. Yep, I added a section under 1.6.2. Would it be possible to cut a 1.6.2 release after this is merged?

@tagomoris
Copy link
Member

@ivan-valkov Yeah, I will.
But I meant the options description in README.md like this.

Signed-off-by: ivan-valkov <iv.v.valkov@gmail.com>
@ivan-valkov
Copy link
Contributor Author

@tagomoris oh sorry, I misunderstood this, my bad. I have added the option description in the README.md now.

Copy link
Member

@tagomoris tagomoris left a comment

Choose a reason for hiding this comment

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

LGTM!

@tagomoris tagomoris merged commit 993443f into fluent:master Sep 26, 2021
@tagomoris
Copy link
Member

Merged!
And I tagged v1.6.2. Thanks for the contribution!

@ivan-valkov ivan-valkov deleted the async-error-callback branch September 26, 2021 12:53
akerouanton added a commit to akerouanton/docker that referenced this pull request Nov 1, 2021
Updates the fluent logger library to v1.7.0. Following PRs were merged
since last bump:

* [Add callback for error handling when using
  async](fluent/fluent-logger-golang#97)
* [Fix panic when accessing unexported struct
  field](fluent/fluent-logger-golang#99)
* [Properly stop logger during (re)connect
  failure](fluent/fluent-logger-golang#82)

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
akerouanton added a commit to akerouanton/docker that referenced this pull request Nov 1, 2021
Updates the fluent logger library to v1.7.0. Following PRs were merged
since last bump:

* [Add callback for error handling when using
  async](fluent/fluent-logger-golang#97)
* [Fix panic when accessing unexported struct
  field](fluent/fluent-logger-golang#99)
* [Properly stop logger during (re)connect
  failure](fluent/fluent-logger-golang#82)

See https://github.com/fluent/fluent-logger-golang/compare/v1.6.1..v1.7.0

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
akerouanton added a commit to akerouanton/docker that referenced this pull request Dec 2, 2021
Updates the fluent logger library to v1.8.0. Following PRs/commits were
merged since last bump:

* [Add callback for error handling when using
  async](fluent/fluent-logger-golang#97)
* [Fix panic when accessing unexported struct
  field](fluent/fluent-logger-golang#99)
* [Properly stop logger during (re)connect
  failure](fluent/fluent-logger-golang#82)
* [Support a TLS-enabled connection](fluent/fluent-logger-golang@e5d6aa1)

See https://github.com/fluent/fluent-logger-golang/compare/v1.6.1..v1.8.0

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
docker-jenkins pushed a commit to docker/docker-ce that referenced this pull request Dec 2, 2021
Updates the fluent logger library to v1.8.0. Following PRs/commits were
merged since last bump:

* [Add callback for error handling when using
  async](fluent/fluent-logger-golang#97)
* [Fix panic when accessing unexported struct
  field](fluent/fluent-logger-golang#99)
* [Properly stop logger during (re)connect
  failure](fluent/fluent-logger-golang#82)
* [Support a TLS-enabled connection](fluent/fluent-logger-golang@e5d6aa1)

See https://github.com/fluent/fluent-logger-golang/compare/v1.6.1..v1.8.0

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
Upstream-commit: e24d61b7efac787ff3d5176d994608937a057522
Component: engine
evol262 pushed a commit to evol262/moby that referenced this pull request Jan 12, 2022
Updates the fluent logger library to v1.8.0. Following PRs/commits were
merged since last bump:

* [Add callback for error handling when using
  async](fluent/fluent-logger-golang#97)
* [Fix panic when accessing unexported struct
  field](fluent/fluent-logger-golang#99)
* [Properly stop logger during (re)connect
  failure](fluent/fluent-logger-golang#82)
* [Support a TLS-enabled connection](fluent/fluent-logger-golang@e5d6aa1)

See https://github.com/fluent/fluent-logger-golang/compare/v1.6.1..v1.8.0

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
PettitWesley added a commit to PettitWesley/moby that referenced this pull request Jan 12, 2022
Updates the fluent logger library to v1.8.0. Following PRs/commits were
merged since last bump:

* [Add callback for error handling when using
  async](fluent/fluent-logger-golang#97)
* [Fix panic when accessing unexported struct
  field](fluent/fluent-logger-golang#99)
* [Properly stop logger during (re)connect
  failure](fluent/fluent-logger-golang#82)
* [Support a TLS-enabled connection](fluent/fluent-logger-golang@e5d6aa1)

See https://github.com/fluent/fluent-logger-golang/compare/v1.6.1..v1.8.0

Signed-off-by: Wesley <wppttt@amazon.com>
PettitWesley pushed a commit to PettitWesley/moby that referenced this pull request Jan 13, 2022
Updates the fluent logger library to v1.8.0. Following PRs/commits were
merged since last bump:

* [Add callback for error handling when using
  async](fluent/fluent-logger-golang#97)
* [Fix panic when accessing unexported struct
  field](fluent/fluent-logger-golang#99)
* [Properly stop logger during (re)connect
  failure](fluent/fluent-logger-golang#82)
* [Support a TLS-enabled connection](fluent/fluent-logger-golang@e5d6aa1)

See https://github.com/fluent/fluent-logger-golang/compare/v1.6.1..v1.8.0

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
(cherry picked from commit e24d61b)
Signed-off-by: Wesley <wppttt@amazon.com>
lmbarros pushed a commit to balena-os/balena-engine that referenced this pull request Nov 22, 2022
Updates the fluent logger library to v1.8.0. Following PRs/commits were
merged since last bump:

* [Add callback for error handling when using
  async](fluent/fluent-logger-golang#97)
* [Fix panic when accessing unexported struct
  field](fluent/fluent-logger-golang#99)
* [Properly stop logger during (re)connect
  failure](fluent/fluent-logger-golang#82)
* [Support a TLS-enabled connection](fluent/fluent-logger-golang@e5d6aa1)

See https://github.com/fluent/fluent-logger-golang/compare/v1.6.1..v1.8.0

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
(cherry picked from commit e24d61b)
Signed-off-by: Wesley <wppttt@amazon.com>
lmbarros pushed a commit to balena-os/balena-engine that referenced this pull request Nov 22, 2022
Updates the fluent logger library to v1.8.0. Following PRs/commits were
merged since last bump:

* [Add callback for error handling when using
  async](fluent/fluent-logger-golang#97)
* [Fix panic when accessing unexported struct
  field](fluent/fluent-logger-golang#99)
* [Properly stop logger during (re)connect
  failure](fluent/fluent-logger-golang#82)
* [Support a TLS-enabled connection](fluent/fluent-logger-golang@e5d6aa1)

See https://github.com/fluent/fluent-logger-golang/compare/v1.6.1..v1.8.0

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
(cherry picked from commit e24d61b)
Signed-off-by: Wesley <wppttt@amazon.com>
lmbarros pushed a commit to balena-os/balena-engine that referenced this pull request Dec 8, 2022
Updates the fluent logger library to v1.8.0. Following PRs/commits were
merged since last bump:

* [Add callback for error handling when using
  async](fluent/fluent-logger-golang#97)
* [Fix panic when accessing unexported struct
  field](fluent/fluent-logger-golang#99)
* [Properly stop logger during (re)connect
  failure](fluent/fluent-logger-golang#82)
* [Support a TLS-enabled connection](fluent/fluent-logger-golang@e5d6aa1)

See https://github.com/fluent/fluent-logger-golang/compare/v1.6.1..v1.8.0

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
(cherry picked from commit e24d61b)
Signed-off-by: Wesley <wppttt@amazon.com>
lmbarros pushed a commit to balena-os/balena-engine that referenced this pull request Dec 21, 2022
Updates the fluent logger library to v1.8.0. Following PRs/commits were
merged since last bump:

* [Add callback for error handling when using
  async](fluent/fluent-logger-golang#97)
* [Fix panic when accessing unexported struct
  field](fluent/fluent-logger-golang#99)
* [Properly stop logger during (re)connect
  failure](fluent/fluent-logger-golang#82)
* [Support a TLS-enabled connection](fluent/fluent-logger-golang@e5d6aa1)

See https://github.com/fluent/fluent-logger-golang/compare/v1.6.1..v1.8.0

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
(cherry picked from commit e24d61b)
Signed-off-by: Wesley <wppttt@amazon.com>
lmbarros pushed a commit to balena-os/balena-engine that referenced this pull request Feb 7, 2023
Updates the fluent logger library to v1.8.0. Following PRs/commits were
merged since last bump:

* [Add callback for error handling when using
  async](fluent/fluent-logger-golang#97)
* [Fix panic when accessing unexported struct
  field](fluent/fluent-logger-golang#99)
* [Properly stop logger during (re)connect
  failure](fluent/fluent-logger-golang#82)
* [Support a TLS-enabled connection](fluent/fluent-logger-golang@e5d6aa1)

See https://github.com/fluent/fluent-logger-golang/compare/v1.6.1..v1.8.0

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
(cherry picked from commit e24d61b)
Signed-off-by: Wesley <wppttt@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants