Class: Rollbar::Truncation::RemoveExtraStrategy

Inherits:
Object
  • Object
show all
Includes:
Mixin
Defined in:
lib/rollbar/truncation/remove_extra_strategy.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Mixin

#dump, #select_frames, #truncate?

Class Method Details

.call(payload) ⇒ Object



8
9
10
# File 'lib/rollbar/truncation/remove_extra_strategy.rb', line 8

def self.call(payload)
  new.call(payload)
end

Instance Method Details

#call(payload) ⇒ Object



12
13
14
15
16
17
18
19
20
# File 'lib/rollbar/truncation/remove_extra_strategy.rb', line 12

def call(payload)
  body = payload['data']['body']

  delete_message_extra(body)
  delete_trace_chain_extra(body)
  delete_trace_extra(body)

  dump(payload)
end

#delete_message_extra(body) ⇒ Object



22
23
24
# File 'lib/rollbar/truncation/remove_extra_strategy.rb', line 22

def delete_message_extra(body)
  body['message'].delete('extra') if body['message'] && body['message']['extra']
end

#delete_trace_chain_extra(body) ⇒ Object



26
27
28
29
30
# File 'lib/rollbar/truncation/remove_extra_strategy.rb', line 26

def delete_trace_chain_extra(body)
  return unless body['trace_chain'] && body['trace_chain'][0]['extra']

  body['trace_chain'][0].delete('extra')
end

#delete_trace_extra(body) ⇒ Object



32
33
34
# File 'lib/rollbar/truncation/remove_extra_strategy.rb', line 32

def delete_trace_extra(body)
  body['trace'].delete('extra') if body['trace'] && body['trace']['extra']
end