Sha256: a4ef54e29d52a7fec7545344d48231342762dea1814272e911255ed1e41ca849

Contents?: true

Size: 416 Bytes

Versions: 22

Compression:

Stored size: 416 Bytes

Contents

# frozen_string_literal: true

module Sentry
  module Utils
    module RequestId
      REQUEST_ID_HEADERS = %w[action_dispatch.request_id HTTP_X_REQUEST_ID].freeze

      # Request ID based on ActionDispatch::RequestId
      def self.read_from(env)
        REQUEST_ID_HEADERS.each do |key|
          request_id = env[key]
          return request_id if request_id
        end
        nil
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 2 rubygems

Version Path
sentry-ruby-5.21.0 lib/sentry/utils/request_id.rb
sentry-ruby-core-5.21.0 lib/sentry/utils/request_id.rb
sentry-ruby-5.20.1 lib/sentry/utils/request_id.rb
sentry-ruby-core-5.20.1 lib/sentry/utils/request_id.rb
sentry-ruby-5.20.0 lib/sentry/utils/request_id.rb
sentry-ruby-core-5.20.0 lib/sentry/utils/request_id.rb
sentry-ruby-core-5.19.0 lib/sentry/utils/request_id.rb
sentry-ruby-5.19.0 lib/sentry/utils/request_id.rb
sentry-ruby-core-5.18.2 lib/sentry/utils/request_id.rb
sentry-ruby-5.18.2 lib/sentry/utils/request_id.rb
sentry-ruby-core-5.18.1 lib/sentry/utils/request_id.rb
sentry-ruby-5.18.1 lib/sentry/utils/request_id.rb
sentry-ruby-5.18.0 lib/sentry/utils/request_id.rb
sentry-ruby-core-5.18.0 lib/sentry/utils/request_id.rb
sentry-ruby-core-5.17.3 lib/sentry/utils/request_id.rb
sentry-ruby-5.17.3 lib/sentry/utils/request_id.rb
sentry-ruby-5.17.2 lib/sentry/utils/request_id.rb
sentry-ruby-core-5.17.2 lib/sentry/utils/request_id.rb
sentry-ruby-core-5.17.1 lib/sentry/utils/request_id.rb
sentry-ruby-5.17.1 lib/sentry/utils/request_id.rb