honeycomb-beeline 1.0.0.pre.alpha → 1.0.0.pre.alpha1

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.
@@ -0,0 +1,40 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "forwardable"
4
+ require "securerandom"
5
+ require "honeycomb/span"
6
+ require "honeycomb/propagation"
7
+
8
+ module Honeycomb
9
+ # Represents a Honeycomb trace, which groups spans together
10
+ class Trace
11
+ include PropagationParser
12
+ extend Forwardable
13
+
14
+ def_delegators :@root_span, :send
15
+
16
+ attr_reader :id, :fields, :root_span, :rollup_fields
17
+
18
+ def initialize(builder:, context:, serialized_trace: nil)
19
+ trace_id, parent_span_id, trace_fields, dataset =
20
+ parse serialized_trace
21
+ dataset && builder.dataset = dataset
22
+ @id = trace_id || SecureRandom.uuid
23
+ @rollup_fields = Hash.new(0)
24
+ @fields = trace_fields || {}
25
+ @root_span = Span.new(trace: self,
26
+ parent_id: parent_span_id,
27
+ is_root: true,
28
+ builder: builder,
29
+ context: context)
30
+ end
31
+
32
+ def add_field(key, value)
33
+ @fields[key] = value
34
+ end
35
+
36
+ def add_rollup_field(key, value)
37
+ @rollup_fields[key] += value
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,3 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Needed for the sequel extension to work ¯\_(ツ)_/¯
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: honeycomb-beeline
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.pre.alpha
4
+ version: 1.0.0.pre.alpha1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Holman
@@ -198,9 +198,43 @@ email:
198
198
  executables: []
199
199
  extensions: []
200
200
  extra_rdoc_files: []
201
- files: []
201
+ files:
202
+ - ".gitignore"
203
+ - ".overcommit.yml"
204
+ - ".rspec"
205
+ - ".rubocop.yml"
206
+ - ".ruby-version"
207
+ - ".travis.yml"
208
+ - Appraisals
209
+ - CODE_OF_CONDUCT.md
210
+ - Gemfile
211
+ - Gemfile.lock
212
+ - LICENSE
213
+ - README.md
214
+ - Rakefile
215
+ - UPGRADING.md
216
+ - bin/console
217
+ - bin/setup
218
+ - bundler_version.sh
219
+ - honeycomb-beeline.gemspec
220
+ - lib/generators/honeycomb/honeycomb_generator.rb
221
+ - lib/honeycomb-beeline.rb
222
+ - lib/honeycomb/beeline/version.rb
223
+ - lib/honeycomb/client.rb
224
+ - lib/honeycomb/context.rb
225
+ - lib/honeycomb/integrations/active_support.rb
226
+ - lib/honeycomb/integrations/faraday.rb
227
+ - lib/honeycomb/integrations/rack.rb
228
+ - lib/honeycomb/integrations/rails.rb
229
+ - lib/honeycomb/integrations/sequel.rb
230
+ - lib/honeycomb/integrations/sinatra.rb
231
+ - lib/honeycomb/propagation.rb
232
+ - lib/honeycomb/span.rb
233
+ - lib/honeycomb/trace.rb
234
+ - lib/sequel/extensions/honeycomb.rb
202
235
  homepage: https://honeycomb.io
203
- licenses: []
236
+ licenses:
237
+ - Apache-2.0
204
238
  metadata:
205
239
  homepage_uri: https://honeycomb.io
206
240
  source_code_uri: https://github.com/honeycombio/beeline-ruby