zipkin-tracer 0.46.0 → 0.47.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: facfab4311d80aff894d2c5dec5253ef122ee5206328d875e41d2174373d060e
4
- data.tar.gz: eb036ff2009dc9b70933881c12a93cead129127679bbdf9c538e6df067dc04c7
3
+ metadata.gz: 82721c4960c43ae115304bb20f3cd2bc449118ad9e4a7bab46f83a99faec0d97
4
+ data.tar.gz: 3ab36bb2a93a25222be0ca3e3a2515c8e25ac76f5cc5d90bde304b76be0d27df
5
5
  SHA512:
6
- metadata.gz: 6f99f5a59fdfd10c968fb99779aa0c7a97a559b45a36a787c886cac40845964e5cb98a5048313094ecab328d420ed3b01936cd66e1929389fef2e5eed1401b44
7
- data.tar.gz: 5edb8af0059d1486a1105cf325ec21ce548f795f0a5078b67e8846d0cda23d05db2ab83075a27d1f6f46b173c10bd324af0683e26bc7ea5bd0695424e13880ba
6
+ metadata.gz: 03240e5d579ed704b2019c73249a3aaa76b608328b00cbb6b24bbcf9b0e870069b2ef05b41e3bed6af4fdbb4460b0d3a0cce5e91c1fdd1c31a15b9a1f851e14c
7
+ data.tar.gz: 876c7dd29c0c7adfad87d2207b409acd2a4aa0970ebd15fbe9f0b4820124a6a04038d89c48305896ffb8fa146c6c3957011b44aff44be28467bab4aaaf0ce1e3
@@ -1,3 +1,6 @@
1
+ # 0.47.0
2
+ * Add a `check_routes` option to make the routable request check optional.
3
+
1
4
  # 0.46.0
2
5
  * Add Amazon SQS tracer.
3
6
 
data/README.md CHANGED
@@ -21,6 +21,7 @@ use ZipkinTracer::RackHandler, config
21
21
  * `:service_name` **REQUIRED** - the name of the service being traced. There are two ways to configure this value. Either write the service name in the config file or set the "DOMAIN" environment variable (e.g. 'test-service.example.com' or 'test-service'). The environment variable takes precedence over the config file value.
22
22
  * `:sample_rate` (default: 0.1) - the ratio of requests to sample, from 0 to 1
23
23
  * `:sampled_as_boolean` - When set to true (default but deprecrated), it uses true/false for the `X-B3-Sampled` header. When set to false uses 1/0 which is preferred.
24
+ * `:check_routes` - When set to `true`, only routable requests are sampled. Defaults to `false`.
24
25
  * `:trace_id_128bit` - When set to true, high 8-bytes will be prepended to trace_id. The upper 4-bytes are epoch seconds and the lower 4-bytes are random. This makes it convertible to Amazon X-Ray trace ID format v1. (See http://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-request-tracing.html)
25
26
  * `:async` - By default senders will flush traces asynchronously. Set to `false` to make that process synchronous. Only supported by the HTTP, RabbitMQ, and SQS senders.
26
27
  * `:logger` - The default logger for Rails apps is `Rails.logger`, else it is `STDOUT`. Use this option to pass a custom logger.
@@ -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, :sample_rate, :sampled_as_boolean, :trace_id_128bit, :async, :logger,
8
+ attr_reader :service_name, :sample_rate, :sampled_as_boolean, :check_routes, :trace_id_128bit, :async, :logger,
9
9
  :json_api_host, :zookeeper, :kafka_producer, :kafka_topic, :sqs_queue_name, :sqs_region, :log_tracing,
10
10
  :annotate_plugin, :filter_plugin, :whitelist_plugin, :rabbit_mq_connection, :rabbit_mq_exchange,
11
11
  :rabbit_mq_routing_key, :write_b3_single_format
@@ -47,6 +47,8 @@ module ZipkinTracer
47
47
  if @sampled_as_boolean
48
48
  @logger && @logger.warn("Using a boolean in the Sampled header is deprecated. Consider setting sampled_as_boolean to false")
49
49
  end
50
+ # When set to true, only routable requests are sampled
51
+ @check_routes = config[:check_routes].nil? ? DEFAULTS[:check_routes] : config[:check_routes]
50
52
 
51
53
  # When set to true, high 8-bytes will be prepended to trace_id.
52
54
  # The upper 4-bytes are epoch seconds and the lower 4-bytes are random.
@@ -95,6 +97,7 @@ module ZipkinTracer
95
97
  DEFAULTS = {
96
98
  sample_rate: 0.1,
97
99
  sampled_as_boolean: true,
100
+ check_routes: false,
98
101
  trace_id_128bit: false,
99
102
  write_b3_single_format: false
100
103
  }
@@ -71,7 +71,7 @@ module ZipkinTracer
71
71
  if parent_trace_sampled # A service upstream decided this goes in all the way
72
72
  parent_trace_sampled
73
73
  else
74
- new_sampled_header_value(force_sample? || current_trace_sampled? && !filtered? && routable_request?)
74
+ new_sampled_header_value(force_sample? || current_trace_sampled? && !filtered? && traceable_request?)
75
75
  end
76
76
  end
77
77
 
@@ -83,9 +83,10 @@ module ZipkinTracer
83
83
  @config.filter_plugin && !@config.filter_plugin.call(@env)
84
84
  end
85
85
 
86
- def routable_request?
86
+ def traceable_request?
87
+ return true unless @config.check_routes
88
+
87
89
  Application.routable_request?(@env)
88
90
  end
89
-
90
91
  end
91
92
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ZipkinTracer
4
- VERSION = '0.46.0'
4
+ VERSION = '0.47.0'
5
5
  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.46.0
4
+ version: 0.47.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Franklin Hu
@@ -14,7 +14,7 @@ authors:
14
14
  autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
- date: 2020-05-29 00:00:00.000000000 Z
17
+ date: 2020-08-30 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: faraday