lib/sentry/rails/action_cable.rb in sentry-rails-5.17.3 vs lib/sentry/rails/action_cable.rb in sentry-rails-5.18.0

- old
+ new

@@ -1,10 +1,11 @@ module Sentry module Rails module ActionCableExtensions class ErrorHandler OP_NAME = "websocket.server".freeze + SPAN_ORIGIN = "auto.http.rails.actioncable" class << self def capture(connection, transaction_name:, extra_context: nil, &block) return block.call unless Sentry.initialized? # ActionCable's ConnectionStub (for testing) doesn't implement the exact same interfaces as Connection::Base. @@ -31,10 +32,16 @@ end end end def start_transaction(env, scope) - options = { name: scope.transaction_name, source: scope.transaction_source, op: OP_NAME } + options = { + name: scope.transaction_name, + source: scope.transaction_source, + op: OP_NAME, + origin: SPAN_ORIGIN + } + transaction = Sentry.continue_trace(env, **options) Sentry.start_transaction(transaction: transaction, **options) end def finish_transaction(transaction, status_code)