Skip to content

Commit

Permalink
WIP changes for config to skip specific browser scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
kaylareopelle committed Feb 23, 2024
1 parent 8f1bd90 commit 786000a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/new_relic/agent/configuration/default_source.rb
Original file line number Diff line number Diff line change
Expand Up @@ -741,9 +741,9 @@ def self.enforce_fallback(allowed_values: nil, fallback: nil)
:'browser_monitoring.ignored_scripts' => {
:default => ['/sidekiq'],
:public => true,
:type => Arrat,
:type => Array,
:allowed_from_server => false,
:description => 'An array of SCRIPT_NAME header values where the browser monitoring Javascript header should not be injected. This header is defined in the [Rack environment](https://github.com/rack/rack/blob/main/SPEC.rdoc#the-environment-).'
:description => 'An array of SCRIPT_NAME environment values where the browser monitoring JavaScript header should not be injected. This header is defined in the [Rack environment](https://github.com/rack/rack/blob/main/SPEC.rdoc#the-environment-).'
},
# Transaction events
:'transaction_events.enabled' => {
Expand Down
4 changes: 2 additions & 2 deletions lib/new_relic/rack/browser_monitoring.rb
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ def streaming?(env, headers)
end

def ignored_script?(env)
NewRelic::Agent.config[:browser_monitoring.ignored_scripts].each do |script|
break false if env['SCRIPT_NAME'] == script
NewRelic::Agent.config[:'browser_monitoring.ignored_scripts'].each do |script|
break true if env['SCRIPT_NAME'] == script
end
end

Expand Down

0 comments on commit 786000a

Please sign in to comment.