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.
- checksums.yaml +4 -4
- data/.gitignore +13 -0
- data/.overcommit.yml +8 -0
- data/.rspec +3 -0
- data/.rubocop.yml +56 -0
- data/.ruby-version +1 -0
- data/.travis.yml +48 -0
- data/Appraisals +61 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +8 -0
- data/Gemfile.lock +126 -0
- data/LICENSE +201 -0
- data/README.md +37 -0
- data/Rakefile +16 -0
- data/UPGRADING.md +82 -0
- data/bin/console +15 -0
- data/bin/setup +8 -0
- data/bundler_version.sh +12 -0
- data/honeycomb-beeline.gemspec +54 -0
- data/lib/generators/honeycomb/honeycomb_generator.rb +37 -0
- data/lib/honeycomb-beeline.rb +74 -0
- data/lib/honeycomb/beeline/version.rb +9 -0
- data/lib/honeycomb/client.rb +79 -0
- data/lib/honeycomb/context.rb +40 -0
- data/lib/honeycomb/integrations/active_support.rb +68 -0
- data/lib/honeycomb/integrations/faraday.rb +57 -0
- data/lib/honeycomb/integrations/rack.rb +94 -0
- data/lib/honeycomb/integrations/rails.rb +47 -0
- data/lib/honeycomb/integrations/sequel.rb +31 -0
- data/lib/honeycomb/integrations/sinatra.rb +18 -0
- data/lib/honeycomb/propagation.rb +58 -0
- data/lib/honeycomb/span.rb +125 -0
- data/lib/honeycomb/trace.rb +40 -0
- data/lib/sequel/extensions/honeycomb.rb +3 -0
- metadata +37 -3
@@ -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
|
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.
|
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
|