Sha256: 07f387ceb568b68019986cdd1918df7b43f40966be5ddd1343b54539192ebd40

Contents?: true

Size: 327 Bytes

Versions: 5

Compression:

Stored size: 327 Bytes

Contents

require 'socket'

module Zipkin
  class Endpoint
    LOCAL_IP = (
      Socket.ip_address_list.detect(&:ipv4_private?) ||
      Socket.ip_address_list.reverse.detect(&:ipv4?)
    ).ip_address

    def self.local_endpoint(service_name)
      {
        serviceName: service_name,
        ipv4: LOCAL_IP
      }
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
zipkin-1.2.0 lib/zipkin/endpoint.rb
zipkin-1.1.0 lib/zipkin/endpoint.rb
zipkin-1.0.0 lib/zipkin/endpoint.rb
zipkin-0.4.2 lib/zipkin/endpoint.rb
zipkin-0.4.1 lib/zipkin/endpoint.rb