request-tracer 0.5.2 → 0.5.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZjEzN2Y3NGVjYTgzOGIwYzhlZDBiMjk4MDk1Y2M0ZjI2YThhZDU2MA==
4
+ NzMwYTk0ZmM5YTBhMjk3ZDY3YmMyMTgzZGI5MWIwNTJiOGU4OWE3Nw==
5
5
  data.tar.gz: !binary |-
6
- ZWYzMDRiYjliZjk2MGJiOGM5Yzc4MTA2YzAxOGVmNWJlNDM0OWZiMA==
6
+ OGM2NjRhN2IzZDlmYzA5MjZkM2JiMmI4NWY0YzQ4MjY2MzI4M2M3Zg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YjJhZjU5MjRhYzg2MDY1MjNhMzkxNThkYTgyYTUyMDNmOGQ3MDU2NDQ2Y2U3
10
- Y2ZjNjE5ZTQzNTYzMTVmNmE4ZDdkMmRjYjNjN2JmNDAyYWJlZTlkNzE4YmUy
11
- NTRiYjc5ODY5ZjMxNzk3MDM3NjljZmEzNzE2MTI5MmRjYWU1MDA=
9
+ YjFlZjU3ZDhlOGZkMTI2YzU1MjI0OWVjYzNiZjk4YjI3ODllMjljYjAyNzM0
10
+ YzJmMmU1YTY5MDMyYzhmMzUzYmI3ZTY1OTI1MmJlMjA1ZWQ3OWZlNjY5Njhm
11
+ MzA2MzU3YjFkZmU1ZjhhY2NiZWMxYjZlYmM0YzllZGM2NmZkYzE=
12
12
  data.tar.gz: !binary |-
13
- NDA1YjVhMmVhY2UwOWUxYTYwODE1Nzc4ZGFmNDZjNGMwZGU5MjEwOTZmYmE2
14
- ZTQ5YTAzOTM5MmU0MWZjYTFhMjMyNDQyZDgwNGRhOTBjZmQ0NWNkMjlhMmM2
15
- NTcxZTA0Y2FhMzM4NDljZWMyYzEwNGZhNjE1ZDJjMmMwYzQzZjI=
13
+ MTNmNWI1MWRiNTY4MjE3NTNhNGUyMjgzY2FlNzY0ZmZkNGQ3OWMyOTQ1Y2Fi
14
+ NjAwMWQ0NWFmNDNhMTVkNzgyYWUzY2Y1NWMwODU5ZDdmOTgyM2E2NmU5ZDY5
15
+ M2ExZjZhOTc3YWVkODdlMGUyOTViZDAwOTE4ZjU0ZTFhMDZhOGQ=
@@ -1,12 +1,6 @@
1
1
  module RequestTracer
2
2
  module Integration
3
3
  module Base
4
- B3_REQUIRED_FIELDS = %w(trace_id parent_span_id span_id)
5
- B3_REQUIRED_FIELDS_FROM_SHORT_NAMES = B3_REQUIRED_FIELDS.map {|f| [f.gsub("_", ""), f] }.to_h
6
- B3_REQUIRED_HEADERS = B3_REQUIRED_FIELDS.map {|f| "HTTP_X_B3_#{f.gsub("_", "").upcase}" }
7
- B3_REQUIRED_FIELD_HEADER_MAP = B3_REQUIRED_FIELDS.zip(B3_REQUIRED_HEADERS).to_h
8
- B3_REQUIRED_HEADER_FIELD_MAP = B3_REQUIRED_HEADERS.zip(B3_REQUIRED_FIELDS).to_h
9
- B3_OPT_HEADERS = %w[HTTP_X_B3_FLAGS]
10
4
  def extract_fields_from_headers(header_hash)
11
5
  header_hash.map do |k,v|
12
6
  special_header = /HTTP_X_B3_(.*)/.match(k)
@@ -1,3 +1,3 @@
1
1
  module RequestTracer
2
- VERSION = "0.5.2"
2
+ VERSION = "0.5.3"
3
3
  end
@@ -1,4 +1,11 @@
1
1
  module RequestTracer
2
+ B3_REQUIRED_FIELDS = %w(trace_id parent_span_id span_id)
3
+ B3_REQUIRED_FIELDS_FROM_SHORT_NAMES = B3_REQUIRED_FIELDS.map {|f| [f.gsub("_", ""), f] }.to_h
4
+ B3_REQUIRED_HEADERS = B3_REQUIRED_FIELDS.map {|f| "HTTP_X_B3_#{f.gsub("_", "").upcase}" }
5
+ B3_REQUIRED_FIELD_HEADER_MAP = B3_REQUIRED_FIELDS.zip(B3_REQUIRED_HEADERS).to_h
6
+ B3_REQUIRED_HEADER_FIELD_MAP = B3_REQUIRED_HEADERS.zip(B3_REQUIRED_FIELDS).to_h
7
+ B3_OPT_HEADERS = %w[HTTP_X_B3_FLAGS]
8
+
2
9
  def self.integrate_with(*services)
3
10
  services.each do |service|
4
11
  require_relative "request_tracer/integration/#{service}_handler"
@@ -37,7 +37,7 @@ describe RequestTracer::Integration::RackHandler do
37
37
  end
38
38
  end
39
39
 
40
- let(:trace_headers) { RequestTracer::Integration::RackHandler::B3_REQUIRED_HEADERS.map {|a| [a, rand(1000)] }.to_h }
40
+ let(:trace_headers) { RequestTracer::B3_REQUIRED_HEADERS.map {|a| [a, rand(1000)] }.to_h }
41
41
  context 'Zipkin headers are passed to the middleware' do
42
42
  subject { middleware(service) }
43
43
  it_behaves_like "traces the request"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: request-tracer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Mauch