You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[receiver/kafka] backoff in case of next consumer error (#37009)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
Currently if the next consumer returns an error, kafka receiver simply
returns the error and will consume the next message without any
backpressure. This behavior is not optimal in case of some errors. For
example the memory limiter could return data refused error when the
memory usage of the collector is too high. Keeping consuming and sending
messages to the memory limiter could further increase the memory usage
and cause OutOfMemory error in the collector.
This PR provides an optional error backoff config which allows to wait
before consuming the next message in case of errors that require
backoff.
<!--Describe what testing was performed and which tests were added.-->
#### Testing
- Added a test case to `TestXXXConsumerGroupHandler_error_nextConsumer`
tests with an error that requires backoff.
<!--Describe the documentation added.-->
#### Documentation
- Added the configuration for `error_backoff`
Copy file name to clipboardExpand all lines: receiver/kafkareceiver/README.md
+7Lines changed: 7 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -97,6 +97,13 @@ The following settings can be optionally configured:
97
97
-`extract_headers` (default = false): Allows user to attach header fields to resource attributes in otel pipeline
98
98
-`headers` (default = []): List of headers they'd like to extract from kafka record.
99
99
**Note: Matching pattern will be `exact`. Regexes are not supported as of now.**
100
+
-`error_backoff`: [BackOff](https://github.com/open-telemetry/opentelemetry-collector/blob/v0.116.0/config/configretry/backoff.go#L27-L43) configuration in case of errors
101
+
-`enabled`: (default = false) Whether to enable backoff when next consumers return errors
102
+
-`initial_interval`: The time to wait after the first error before retrying
103
+
-`max_interval`: The upper bound on backoff interval between consecutive retries
104
+
-`multiplier`: The value multiplied by the backoff interval bounds
105
+
-`randomization_factor`: A random factor used to calculate next backoff. Randomized interval = RetryInterval * (1 ± RandomizationFactor)
106
+
-`max_elapsed_time`: The maximum amount of time trying to backoff before giving up. If set to 0, the retries are never stopped.
0 commit comments