From cf812a46ddec60369762d9b2a605c8a6466dd4ba Mon Sep 17 00:00:00 2001 From: Tom de Bruijn Date: Fri, 5 Jul 2024 13:22:36 +0200 Subject: [PATCH] Remove duplicate parameter filtering The Active Job and Sidekiq instrumentations called out to our parameter filtering. It doesn't need to do this. Our Transaction class runs it through the parameter filtering when it calls `sanitized_params` when sampling the transaction. No test updates needed. There were already tests present it filtered out parameters. It still does that. [skip changeset] No behavior change, only an optimization. --- lib/appsignal/hooks/active_job.rb | 7 +------ lib/appsignal/integrations/sidekiq.rb | 12 +----------- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/lib/appsignal/hooks/active_job.rb b/lib/appsignal/hooks/active_job.rb index e5d94fd10..a410c1587 100644 --- a/lib/appsignal/hooks/active_job.rb +++ b/lib/appsignal/hooks/active_job.rb @@ -62,12 +62,7 @@ def execute(job) end if transaction - transaction.set_params_if_nil( - Appsignal::Utils::HashSanitizer.sanitize( - job["arguments"], - Appsignal.config[:filter_parameters] - ) - ) + transaction.set_params_if_nil(job["arguments"]) transaction_tags = ActiveJobHelpers.transaction_tags_for(job) transaction_tags["active_job_id"] = job["job_id"] diff --git a/lib/appsignal/integrations/sidekiq.rb b/lib/appsignal/integrations/sidekiq.rb index f3242d2d5..468dff2b1 100644 --- a/lib/appsignal/integrations/sidekiq.rb +++ b/lib/appsignal/integrations/sidekiq.rb @@ -83,7 +83,7 @@ def call(_worker, item, _queue, &block) raise exception ensure if transaction - transaction.set_params_if_nil(filtered_arguments(item)) + transaction.set_params_if_nil(parse_arguments(item)) transaction.set_http_or_background_queue_start Appsignal::Transaction.complete_current! unless exception @@ -115,16 +115,6 @@ def formatted_action_name(job) "#{sidekiq_action_name}#perform" end - def filtered_arguments(job) - arguments = parse_arguments(job) - return unless arguments - - Appsignal::Utils::HashSanitizer.sanitize( - arguments, - Appsignal.config[:filter_parameters] - ) - end - def formatted_metadata(item) {}.tap do |hash| (item || {}).each do |key, value|