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

[pkg/stanza] Add send_quiet/drop_quiet options for on_error setting #32220

Merged
merged 2 commits into from
Apr 15, 2024

Conversation

ChrsMark
Copy link
Member

@ChrsMark ChrsMark commented Apr 8, 2024

Description:

When stanza operators fail to process a message, no matter if they send the message or drop it an error message is logged. This can be quite "noisy" when users want to set up a best effort operator which on error should only send/drop the message without logging an error.
With introducing the send_quiet and drop_quiet options we provide the option to set the level of the logged error. send_quiet and drop_quiet log the error on debug level.

Link to tracking Issue: #32145

Testing: Added unit-tests

Documentation: Enhanced the operator's docs

Copy link
Contributor

@OverOrion OverOrion left a comment

Choose a reason for hiding this comment

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

Overall LGTM, only the docs part need minor adjustments.

@@ -1,10 +1,21 @@
# `on_error` parameter
The `on_error` parameter determines the error handling strategy an operator should use when it fails to process an entry. There are 2 supported values: `drop` and `send`.
The `on_error` parameter determines the error handling strategy an operator should use when it fails to
process an entry. There are 2 supported values: `drop` and `send`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
process an entry. There are 2 supported values: `drop` and `send`.
process an entry. There are 4 supported values: `drop`, `send`, `send_quiet`, and `drop_quiet`.

operators are defined which might flood the logs with errors.

### `drop_quiet`
Copy link
Contributor

Choose a reason for hiding this comment

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

[nit]
How about the following order?

  • drop
  • drop_quiet
  • send
  • send_quiet

When stanza operators fail to process a message, no matter
if they send the message or drop it an error message is logged.
This can be quite "noisy" when users want to set up a best effort
operator which on error should only send/drop the message
without logging an error.
With introducing the send_quiet and drop_quiet options
we provide the option to set the level of the logged error.
send_quiet and drop_quiet will log the error on debug level.

Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
pkg/stanza/docs/types/on_error.md Outdated Show resolved Hide resolved
@djaglowski djaglowski merged commit 7aa95fa into open-telemetry:main Apr 15, 2024
170 checks passed
@github-actions github-actions bot added this to the next release milestone Apr 15, 2024
LokeshOpsramp pushed a commit to opsramp/opentelemetry-collector-contrib that referenced this pull request May 5, 2024
…ng (open-telemetry#32220)

**Description:** <Describe what has changed.>
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->

When stanza operators fail to process a message, no matter if they send
the message or drop it an error message is logged. This can be quite
"noisy" when users want to set up a best effort operator which on error
should only send/drop the message without logging an error.
With introducing the `send_quiet` and `drop_quiet` options we provide
the option to set the level of the logged error. `send_quiet` and
`drop_quiet` log the error on debug level.

**Link to tracking Issue:**
open-telemetry#32145

**Testing:** <Describe what testing was performed and which tests were
added.> Added
[unit-tests](https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/32220/files#diff-6a03331b322fcfd255ead096ac5c7c9dd9267a2d6697ea629548f37f4049896aR70)

**Documentation:** <Describe the documentation added.> [Enhanced the
operator's
docs](https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/32220/files#diff-8f730eb2d61d9ca8c5cf863e9e7f3ddfe51984c46c6259dd7258902d6cc10090L2)

---------

Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
Co-authored-by: Daniel Jaglowski <jaglows3@gmail.com>
rimitchell pushed a commit to rimitchell/opentelemetry-collector-contrib that referenced this pull request May 8, 2024
…ng (open-telemetry#32220)

**Description:** <Describe what has changed.>
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->

When stanza operators fail to process a message, no matter if they send
the message or drop it an error message is logged. This can be quite
"noisy" when users want to set up a best effort operator which on error
should only send/drop the message without logging an error.
With introducing the `send_quiet` and `drop_quiet` options we provide
the option to set the level of the logged error. `send_quiet` and
`drop_quiet` log the error on debug level.

**Link to tracking Issue:**
open-telemetry#32145

**Testing:** <Describe what testing was performed and which tests were
added.> Added
[unit-tests](https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/32220/files#diff-6a03331b322fcfd255ead096ac5c7c9dd9267a2d6697ea629548f37f4049896aR70)

**Documentation:** <Describe the documentation added.> [Enhanced the
operator's
docs](https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/32220/files#diff-8f730eb2d61d9ca8c5cf863e9e7f3ddfe51984c46c6259dd7258902d6cc10090L2)

---------

Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
Co-authored-by: Daniel Jaglowski <jaglows3@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants