debian-mirror-gitlab/lib/gitlab/tracing/rails/rails_common.rb
2019-03-02 22:35:43 +05:30

24 lines
655 B
Ruby

# frozen_string_literal: true
module Gitlab
module Tracing
module Rails
module RailsCommon
extend ActiveSupport::Concern
include Gitlab::Tracing::Common
class_methods do
def create_unsubscriber(subscriptions)
-> { subscriptions.each { |subscriber| ActiveSupport::Notifications.unsubscribe(subscriber) } }
end
end
def generate_span_for_notification(operation_name, start, finish, payload, tags)
exception = payload[:exception]
postnotify_span(operation_name, start, finish, tags: tags, exception: exception)
end
end
end
end
end