inc: Add logs to Arroyo to track behavior during paused and empty message states#439
Open
inc: Add logs to Arroyo to track behavior during paused and empty message states#439
Conversation
fpacifici
requested changes
Apr 3, 2025
fpacifici
approved these changes
Apr 4, 2025
arroyo/processing/processor.py
Outdated
|
|
||
| METRICS_FREQUENCY_SEC = 1.0 # In seconds | ||
| BACKPRESSURE_THRESHOLD = 5.0 # In seconds | ||
| LOGGING_FREQUENCY_SEC = 60.0 # In seconds |
Contributor
There was a problem hiding this comment.
Let's make it longer now that we know what the likely issue is.
64 consumers would log this every second.
What about once every 2-3 minutes ?
added 3 commits
April 4, 2025 15:13
untitaker
reviewed
Apr 7, 2025
| def _run_once(self) -> None: | ||
| self.__metrics_buffer.incr_counter("arroyo.consumer.run.count", 1) | ||
|
|
||
| if time.time() - self.__last_run_log_ts >= LOGGING_FREQUENCY_SEC: |
Member
There was a problem hiding this comment.
please only calculate time.time() once, it's already very expensive to run it per _run_once
we also already have a counter metric for this, what is the purpose of the log?
Contributor
Author
There was a problem hiding this comment.
Per-consumer breakdown
arroyo/processing/processor.py
Outdated
| ) | ||
|
|
||
| self.__last_run_log_ts = time.time() # This is for throttling the logging of each run loop per-consumer | ||
| self.__last_pause_ts = None |
Member
There was a problem hiding this comment.
you can simplify your logic by setting all of these to 0, then you don't have to check for None
|
|
||
| # Records a log if the consumer has been active but receiving no message from poll() for longer than a threshold duration | ||
| elif time.time() - self.__last_empty_msg_ts >= LOGGING_FREQUENCY_SEC: | ||
| logger.info(f"Consumer is not paused but did not receive a message from underlying consumer for {LOGGING_FREQUENCY_SEC} seconds") |
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We currently don't have these logs, which will also be helpful for breaking down per-consumer