zipkin-tracer 0.32.3 → 0.32.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 52e56ec6a1e629c901452ef3109f5e3f02352b6d4a65c3f1bc1b72ebec4037c7
4
- data.tar.gz: 06fecb15b5b1f40266989317e189feab78a810acef2dda4addfd683d02cc1560
3
+ metadata.gz: c3d88ef693423edc75cf6fcddfd3197bf653a6629ee36febbeaeda1eafa08ff4
4
+ data.tar.gz: c1e83e93144a84a8eaa632dbc50f90e32ee15414614faf3cda15d08f4a06dd18
5
5
  SHA512:
6
- metadata.gz: b9230146ede933bbb7753b71b53215acb6f0f78eccb41a3d354d1f8a18798721eaa76b08eb55c8278f6707435f16aa8e93e9fbf31931146625a3d5139b8ccc4c
7
- data.tar.gz: 97c3c18b738903252f078f7a5af4ce19a41c3b97184cf3a7a2ecae5e54b01dc6c11fe2ec0535bb6a91301486f7062f341c630176ebaa82dd6a6b57885e848990
6
+ metadata.gz: 1904ec28b08c0be932e19a6f46275cd48d515bc9002739cfc0d799e89da40eba8f3c0f983f6594ac4c38e2f8a7f19880ae03b2aadd7750cb83545a98c4db78d9
7
+ data.tar.gz: fd5c944ce0bfc2024f04562373dbe0185e6da0df9e07392bea5ba9ec197e641126bca4e3e133f9eee1b1abcee4c909ebfc8ea8a7e8eec1c07e2e6a4c68e22e5b
@@ -5,7 +5,7 @@ require 'zipkin-tracer/rack/zipkin-tracer'
5
5
  module ZipkinTracer
6
6
  # Configuration of this gem. It reads the configuration and provides default values
7
7
  class Config
8
- attr_reader :service_name, :service_port, :json_api_host,
8
+ attr_reader :service_name, :json_api_host,
9
9
  :zookeeper, :sample_rate, :logger, :log_tracing,
10
10
  :annotate_plugin, :filter_plugin, :whitelist_plugin,
11
11
  :sampled_as_boolean, :record_on_server_receive,
@@ -15,8 +15,6 @@ module ZipkinTracer
15
15
  config = config_hash || Application.config(app)
16
16
  # The name of the current service
17
17
  @service_name = config[:service_name]
18
- # The port where the current service is running
19
- @service_port = config[:service_port] || DEFAULTS[:service_port]
20
18
  # The address of the Zipkin server which we will send traces to
21
19
  @json_api_host = config[:json_api_host]
22
20
  # Zookeeper information
@@ -74,7 +72,6 @@ module ZipkinTracer
74
72
 
75
73
  DEFAULTS = {
76
74
  sample_rate: 0.1,
77
- service_port: 80,
78
75
  sampled_as_boolean: true,
79
76
  trace_id_128bit: false
80
77
  }
@@ -40,7 +40,7 @@ module ZipkinTracer
40
40
 
41
41
  private
42
42
 
43
- SERVER_ADDRESS_SPECIAL_VALUE = '1'.freeze
43
+ SERVER_ADDRESS_SPECIAL_VALUE = true
44
44
  STATUS_ERROR_REGEXP = /\A(4.*|5.*)\z/.freeze
45
45
 
46
46
  def b3_headers
@@ -25,7 +25,7 @@ module ZipkinTracer
25
25
 
26
26
  private
27
27
 
28
- SERVER_ADDRESS_SPECIAL_VALUE = '1'.freeze
28
+ SERVER_ADDRESS_SPECIAL_VALUE = true
29
29
  STATUS_ERROR_REGEXP = /\A(4.*|5.*)\z/.freeze
30
30
 
31
31
 
@@ -235,7 +235,8 @@ module Trace
235
235
  end
236
236
 
237
237
  def record_tag(key, value, type = Trace::BinaryAnnotation::Type::STRING, endpoint = Trace.default_endpoint)
238
- binary_annotations << Trace::BinaryAnnotation.new(key, value.to_s, type, endpoint)
238
+ value = value.to_s if type == Trace::BinaryAnnotation::Type::STRING
239
+ binary_annotations << Trace::BinaryAnnotation.new(key, value, type, endpoint)
239
240
  end
240
241
 
241
242
  def record_local_component(value)
@@ -274,9 +275,9 @@ module Trace
274
275
  signed_i32
275
276
  end
276
277
 
277
- def self.local_endpoint(service_port, service_name, ip_format)
278
+ def self.local_endpoint(service_name, ip_format)
278
279
  hostname = Socket.gethostname
279
- Endpoint.new(hostname, service_port, service_name, ip_format)
280
+ Endpoint.new(hostname, nil, service_name, ip_format)
280
281
  end
281
282
 
282
283
  def self.remote_endpoint(url, remote_service_name, ip_format)
@@ -285,11 +286,12 @@ module Trace
285
286
  end
286
287
 
287
288
  def to_h
288
- {
289
+ hsh = {
289
290
  ipv4: ipv4,
290
- port: port,
291
291
  serviceName: service_name
292
292
  }
293
+ hsh[:port] = port if port
294
+ hsh
293
295
  end
294
296
 
295
297
  end
@@ -28,7 +28,6 @@ module ZipkinTracer
28
28
  # TODO: move this to the TracerBase and kill scribe tracer
29
29
  ip_format = [:kafka, :kafka_producer].include?(config.adapter) ? :i32 : :string
30
30
  Trace.default_endpoint = Trace::Endpoint.local_endpoint(
31
- config.service_port,
32
31
  service_name(config.service_name),
33
32
  ip_format
34
33
  )
@@ -1,3 +1,3 @@
1
1
  module ZipkinTracer
2
- VERSION = '0.32.3'.freeze
2
+ VERSION = '0.32.4'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zipkin-tracer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.32.3
4
+ version: 0.32.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Franklin Hu
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2019-01-19 00:00:00.000000000 Z
16
+ date: 2019-03-01 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: faraday