hubstep 2.1.2 → 2.1.3

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
  SHA1:
3
- metadata.gz: 84256d93f0060bb666824eece04c2c6b4244f62e
4
- data.tar.gz: f766e8489277b2c52f7f0eb4df658ac1a1e0cbce
3
+ metadata.gz: 1d172cddae9dfbe1db1be1dec6eaa5e8a034f75f
4
+ data.tar.gz: e5995cefaa791a0d5125c0889ad765caf52f6728
5
5
  SHA512:
6
- metadata.gz: ed2df4cf9913b6fb3657938135f6a315f7934dca95a4aab095c873d787074ee52e169e55fe553105b8846228a2268692fee434ca327a37223a190411c348ecbf
7
- data.tar.gz: d24c795ba27266c2a3012ce428d7615becd772e1d0ee7ef159d13f051332f0f18cbc0d2cd1a0c55c265d33f0cbcf4441d45ccccf821bfb79603bba8192aa7c47
6
+ metadata.gz: 3522d3e11684b7d0bb7339ac106b12760ab5d3736faf99692cfe73759b84b407547bf8abcb57da7110d4b509c4cd6ea89d6ffbe70b73c1bffad39cb1c13b1158
7
+ data.tar.gz: 83fd278795ff62b54bc274c8e1a7914b528963309d1a0cb83f5186265db90164daf2e2ab300f1f9337e70ec01c8e48743afd5188ccf29f0f20d222cd987010e1
@@ -126,6 +126,32 @@ module HubStep
126
126
  @tracer.flush if enabled?
127
127
  end
128
128
 
129
+ # Inject a SpanContext into the given carrier
130
+ #
131
+ # span_context - A SpanContext
132
+ # format - A LightStep::Tracer format
133
+ # carrier - A Hash
134
+ #
135
+ # Example:
136
+ #
137
+ # tracer.span("request") do |span|
138
+ # carrier = {}
139
+ # tracer.inject(
140
+ # span.span_context,
141
+ # LightStep::Tracer::FORMAT_TEXT_MAP,
142
+ # carrier
143
+ # )
144
+ #
145
+ # client.request(data, headers: carrier)
146
+ # end
147
+ #
148
+ # Returns nil but mutates the carrier.
149
+ def inject(span_context, format, carrier)
150
+ return unless enabled?
151
+
152
+ @tracer.inject(span_context, format, carrier)
153
+ end
154
+
129
155
  private
130
156
 
131
157
  def default_transport
@@ -177,6 +203,10 @@ module HubStep
177
203
  nil
178
204
  end
179
205
 
206
+ def span_context
207
+ InertSpanContext.instance
208
+ end
209
+
180
210
  def log(event: nil, timestamp: nil, **fields) # rubocop:disable Lint/UnusedMethodArgument
181
211
  nil
182
212
  end
@@ -184,6 +214,15 @@ module HubStep
184
214
  def finish(end_time: nil)
185
215
  end
186
216
  end
217
+
218
+ # Mimics the interface and no-op behavior of LightStep::SpanContext. This
219
+ # is used when tracing is disabled.
220
+ class InertSpanContext
221
+ include Singleton
222
+ instance.freeze
223
+
224
+ attr_reader :id, :trace_id, :baggage
225
+ end
187
226
  end
188
227
  end
189
228
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module HubStep
4
- VERSION = "2.1.2"
4
+ VERSION = "2.1.3"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hubstep
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.2
4
+ version: 2.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - GitHub
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-12-05 00:00:00.000000000 Z
11
+ date: 2018-02-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lightstep