Skip to content
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

Handle when Sidekiq::WorkSet payload is a String instead of Hash. #75

Merged
merged 8 commits into from
Nov 14, 2022

Conversation

adamlogic
Copy link
Collaborator

@adamlogic adamlogic commented Nov 11, 2022

It's not clear why they payload wouldn't be a Hash, but we're seeing this error with at least one customer:

[ERROR] [RailsAutoscale] Reporter error: #<TypeError: String does not have #dig method>
[RailsAutoscale] /vendor/ruby/3.1.0/gems/rails-autoscale-sidekiq-1.1.0/lib/rails_autoscale/sidekiq/metrics_collector.rb:24:in `dig'
[RailsAutoscale] /vendor/ruby/3.1.0/gems/rails-autoscale-sidekiq-1.1.0/lib/rails_autoscale/sidekiq/metrics_collector.rb:24:in `block in collect'
[RailsAutoscale] /vendor/ruby/3.1.0/gems/sidekiq-7.0.1/lib/sidekiq/api.rb:1055:in `each'
[RailsAutoscale] /vendor/ruby/3.1.0/gems/sidekiq-7.0.1/lib/sidekiq/api.rb:1055:in `each'
[RailsAutoscale] /vendor/ruby/3.1.0/gems/rails-autoscale-sidekiq-1.1.0/lib/rails_autoscale/sidekiq/metrics_collector.rb:23:in `collect'
[RailsAutoscale] /vendor/ruby/3.1.0/gems/rails-autoscale-core-1.1.0/lib/rails_autoscale/reporter.rb:60:in `block (2 levels) in run_metrics_collection'
[RailsAutoscale] /vendor/ruby/3.1.0/gems/rails-autoscale-core-1.1.0/lib/rails_autoscale/reporter.rb:92:in `log_exceptions'
[RailsAutoscale] /vendor/ruby/3.1.0/gems/rails-autoscale-core-1.1.0/lib/rails_autoscale/reporter.rb:60:in `block in run_metrics_collection'
[RailsAutoscale] /vendor/ruby/3.1.0/gems/rails-autoscale-core-1.1.0/lib/rails_autoscale/reporter.rb:59:in `each'
[RailsAutoscale] /vendor/ruby/3.1.0/gems/rails-autoscale-core-1.1.0/lib/rails_autoscale/reporter.rb:59:in `flat_map'
[RailsAutoscale] /vendor/ruby/3.1.0/gems/rails-autoscale-core-1.1.0/lib/rails_autoscale/reporter.rb:59:in `run_metrics_collection'
[RailsAutoscale] /vendor/ruby/3.1.0/gems/rails-autoscale-core-1.1.0/lib/rails_autoscale/reporter.rb:49:in `block (2 levels) in run_loop'
[RailsAutoscale] /vendor/ruby/3.1.0/gems/rails-autoscale-core-1.1.0/lib/rails_autoscale/reporter.rb:48:in `loop'
[RailsAutoscale] /vendor/ruby/3.1.0/gems/rails-autoscale-core-1.1.0/lib/rails_autoscale/reporter.rb:48:in `block in run_loop'
[INFO] [RailsAutoscale] Reporting 0 metrics

@adamlogic adamlogic changed the title Handle missing dig method when iterating Sidekiq::WorkSet Handle when Sidekiq::WorkSet payload is a String instead of Hash. Nov 11, 2022
@adamlogic adamlogic merged commit aa609af into main Nov 14, 2022
@adamlogic adamlogic deleted the no-method-dig branch November 14, 2022 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant