-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add config option to suppress automatically starting the reporter
This can avoid issues in some applications where additional setup is needed before safely starting the reporter. Specifically, we had a customer who was configuring their Sidekiq Redis connection in `after_initialize`, and our reporter was starting (and attempting to fetch Sidekiq metrics from Redis) before Sidekiq was fully configured.
- Loading branch information
Showing
3 changed files
with
20 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
require "judoscale/config" | ||
|
||
module Judoscale | ||
module Rails | ||
module Config | ||
attr_accessor :start_reporter_after_initialize | ||
|
||
def reset | ||
super | ||
@start_reporter_after_initialize = true | ||
end | ||
end | ||
|
||
::Judoscale::Config.prepend Config | ||
end | ||
end |
This file contains 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
This file contains 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