7
8
9
10
11
12
13
14
15
16
17
18
19
|
# File 'app/models/solid_apm/span_subscriber/action_dispatch.rb', line 7
def self.subscribe
super do |name, start, finish, id, payload|
transaction = SpanSubscriber::Base.transaction
transaction.name = "#{payload[:request].controller_class}##{payload[:request].path_parameters[:action]}"
transaction.end_time = finish
transaction.duration = ((transaction.end_time.to_f - transaction.timestamp.to_f) * 1000).round(6)
transaction.metadata = {
params: payload[:request].params.except(:controller, :action),
context: SpanSubscriber::Base.context
}
SpanSubscriber::Base.context = nil
end
end
|