Sha256: 9d6aab5e12788159c37902721c7c5df3523624e1106319203d83b5d2af16ddcb

Contents?: true

Size: 623 Bytes

Versions: 6

Compression:

Stored size: 623 Bytes

Contents

require 'sqreen/ecosystem/module_api'

module Sqreen
  module Ecosystem
    module Tracing
      module Modules
        module DetermineIp
          class << self
            include ModuleApi::Loggable

            def [](data)
              return data.ip if data.ip

              return nil unless data.host && !data.host.empty?

              begin
                IPSocket.getaddress data.host
              rescue SocketError => e
                logger.info { "Error resolving #{data.host}: #{e.message}" }
                nil
              end
            end
          end
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
sqreen-1.22.0-java lib/sqreen/ecosystem/tracing/modules/determine_ip.rb
sqreen-1.22.0 lib/sqreen/ecosystem/tracing/modules/determine_ip.rb
sqreen-1.21.1-java lib/sqreen/ecosystem/tracing/modules/determine_ip.rb
sqreen-1.21.1 lib/sqreen/ecosystem/tracing/modules/determine_ip.rb
sqreen-1.21.0-java lib/sqreen/ecosystem/tracing/modules/determine_ip.rb
sqreen-1.21.0 lib/sqreen/ecosystem/tracing/modules/determine_ip.rb