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.
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
[extension/healthcheckv2] Add event aggregation logic #32695
[extension/healthcheckv2] Add event aggregation logic #32695
Changes from all commits
56561bb
7e40820
0df5dd0
d139f25
a91af2b
bc7086c
a3016a3
a0e93fe
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this priority going to be fixed for the lifecycle of the component?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is actually fixed for the aggregator as a whole (e.g. all components) for the lifetime of the collector process.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might be alone on this, but I find this a bit hard to read given some of the indirections: we are returning an inlined func, which calls a func var, which calls another func var. They are all simple to understand individually so it's not a huge deal, but I wonder if we could do something for readability here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I replaced the two inline funcs you mentioned with a conditional. I can probably take this one step further and make the
aggregationFunc
a method on theAggregator
. Part of me prefers this logic to stand on its own, since it's somewhat complicated, but I'm open to whatever makes it the most readable / understandable / maintainable etc.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a top-level static function would also work, but the current code looks good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add some comments/tests for this specifically? I assume this is to return the earliest error, but would be nice to see this described more properly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I marked this unresolved because I'm not clear on this either, and I don't believe we have tests for a case where the top-level status is an error and we hit this case. I understand why we do the ordering if we hit this, but it would be nice to see more details about why this case is separate from the one below where we return
matchingEvent
ifisError
is set (on line 139 as of this comment).