lib/sentry/rails/action_cable.rb in sentry-rails-5.5.0 vs lib/sentry/rails/action_cable.rb in sentry-rails-5.6.0

- old
+ new

@@ -1,9 +1,11 @@ module Sentry module Rails module ActionCableExtensions class ErrorHandler + OP_NAME = "websocket.server".freeze + 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. # One thing that's missing is `env`. So calling `connection.env` direclty will fail in test environments when `stub_connection` is used. @@ -31,10 +33,10 @@ def start_transaction(env, scope) sentry_trace = env["HTTP_SENTRY_TRACE"] baggage = env["HTTP_BAGGAGE"] - options = { name: scope.transaction_name, source: scope.transaction_source, op: "rails.action_cable".freeze } + options = { name: scope.transaction_name, source: scope.transaction_source, op: OP_NAME } transaction = Sentry::Transaction.from_sentry_trace(sentry_trace, baggage: baggage, **options) if sentry_trace Sentry.start_transaction(transaction: transaction, **options) end def finish_transaction(transaction, status_code)