-
Notifications
You must be signed in to change notification settings - Fork 25
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
Fix unregisters #3122
Fix unregisters #3122
Conversation
WalkthroughThe changes across various files seem to be part of a larger refactoring effort focused on renaming and improving error handling and logging within a system's flow control and metrics processing components. The updates include renaming methods and log messages for clarity, as well as restructuring how metrics are removed and how related errors are handled. Changes
Poem
TipsChatThere are 3 ways to chat with CodeRabbit's AI:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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.
Review Status
Actionable comments generated: 1
Configuration used: CodeRabbit UI
Files selected for processing (5)
- pkg/otelcollector/metricsprocessor/processor.go (1 hunks)
- pkg/policies/flowcontrol/actuators/concurrency-limiter/concurrency-limiter.go (2 hunks)
- pkg/policies/flowcontrol/actuators/concurrency-scheduler/concurrency-scheduler.go (1 hunks)
- pkg/policies/flowcontrol/actuators/rate-limiter/rate-limiter.go (2 hunks)
- pkg/policies/flowcontrol/actuators/sampler/sampler.go (2 hunks)
Additional comments: 6
pkg/policies/flowcontrol/actuators/sampler/sampler.go (1)
- 268-271: The logic for deleting the sampler counter from the metric vector and logging a warning if the deletion fails is correctly implemented.
pkg/policies/flowcontrol/actuators/concurrency-limiter/concurrency-limiter.go (1)
- 272-275: The logic for deleting the concurrency limiter counter from the metric vector and logging a warning if the deletion fails is correctly implemented.
pkg/policies/flowcontrol/actuators/rate-limiter/rate-limiter.go (2)
290-295: The
UnregisterRateLimiter
method is called within theOnStop
function to unregister the rate limiter from the data engine. Ensure that theUnregisterRateLimiter
method handles potential errors gracefully and that it is safe to call multiple times in case of retries.306-309: The
DeletePartialMatch
method is used to delete the rate limiter counter from its metric vector. The warning log suggests that there might be cases where no metrics were generated, hence no deletion. This could be a normal scenario, but it's important to ensure that the absence of metrics is not due to an error in the metric generation or collection process.pkg/policies/flowcontrol/actuators/concurrency-scheduler/concurrency-scheduler.go (1)
- 289-289: The method call
UnregisterConcurrencyScheduler
is used to unregister the concurrency scheduler from the data engine. It's important to ensure that this method is implemented correctly and handles errors as expected, especially since it's a renaming from a previous method and could have implications on the system's behavior.pkg/otelcollector/metricsprocessor/processor.go (1)
- 248-248: The log message has been changed from "LoadScheduler not found" to "Scheduler not found". Ensure that this new terminology is consistent throughout the entire codebase to avoid confusion.
Verification successful
The search results indicate that the old log message "LoadScheduler not found" is no longer present in the codebase, and the new log message "Scheduler not found" is used in
processor.go
. This suggests that the terminology change has been consistently applied.Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Search for the old log message to ensure it has been updated everywhere. rg --type go '"LoadScheduler not found"' # Search for the new log message to confirm its usage. rg --type go '"Scheduler not found"'Length of output: 159
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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (1)
- pkg/policies/flowcontrol/actuators/sampler/sampler.go (2 hunks)
Additional comments: 2
pkg/policies/flowcontrol/actuators/sampler/sampler.go (2)
259-259: The error message has been corrected to refer to the sampler instead of the rate limiter, aligning with the previous comment and resolution.
268-271: The logic for deleting the sampler counter from the metric vector has been added to the
OnStop
function, with a warning message if no counters are deleted. This change improves the cleanup process by ensuring that metrics are cleaned up when the sampler is stopped.
Description of change
Checklist
Summary by CodeRabbit
Refactor
Bug Fixes