honeycomb-beeline 2.1.0 → 2.1.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: deebe936665edd1d51d0526c7089c0bfa29e666722f8ccff89bf731ce3fd5def
4
- data.tar.gz: 9f4534f0b56c15c113a9c72d9e7b237a243c6ab6208af1bda1f1c79b02b1c7c8
3
+ metadata.gz: 8dc063924a92fcf2aa2ce4bbdcd3ab6bb79666a4d6266e957129f57bb131ee77
4
+ data.tar.gz: 30111f935a4503b82321d30fbf752ff7462951c40c6249357543167d24890130
5
5
  SHA512:
6
- metadata.gz: f9a2f7c6a0c3bc6b92a82672aaeaf2a24a02c703d9830670448acaac6838b7286c91d33af3d9a20049891bde140f1aac1c6f7b615b92b7aa37a0f1f69ab3bddd
7
- data.tar.gz: 65f892432bc418c44d3bb482b8892a5cc0dccbf0a24ff8f051c78de4769e7e61a5d0efdb6b39b015beb759da0be9354eefb3420133d8670477c7b36f63c3ea1f
6
+ metadata.gz: 300c4652b990b2365eb4194702c16012c027beb7b13d396b0129d7ebe8a82a6bf848ab221d0158967f0e2c9d4bbc20d91715dae88f96b7d4f63714cdc03099f0
7
+ data.tar.gz: 546ffeb8520ce66beb3d57223aac4e5131f9b0b0286c90618b11983e8a2821a1e8303ed9faf09a3022564956918a2dad688d8bce6bfa4e185c0e4a253fc72666
@@ -29,6 +29,9 @@ Metrics/LineLength:
29
29
  Exclude:
30
30
  - spec/support/event_data_shared_examples.rb
31
31
 
32
+ Metrics/ParameterLists:
33
+ Max: 6
34
+
32
35
  Style/FrozenStringLiteralComment:
33
36
  EnforcedStyle: always
34
37
  Exclude:
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- honeycomb-beeline (2.1.0)
4
+ honeycomb-beeline (2.1.1)
5
5
  libhoney (~> 1.14, >= 1.14.2)
6
6
 
7
7
  GEM
@@ -3,7 +3,7 @@
3
3
  module Honeycomb
4
4
  module Beeline
5
5
  NAME = "honeycomb-beeline".freeze
6
- VERSION = "2.1.0".freeze
6
+ VERSION = "2.1.1".freeze
7
7
  USER_AGENT_SUFFIX = "#{NAME}/#{VERSION}".freeze
8
8
  end
9
9
  end
@@ -36,11 +36,16 @@ module Honeycomb
36
36
  parse_options(**options)
37
37
  end
38
38
 
39
- def parse_options(parent_id: nil,
39
+ def parse_options(parent: nil,
40
+ parent_id: nil,
40
41
  is_root: parent_id.nil?,
41
42
  sample_hook: nil,
42
43
  presend_hook: nil,
43
44
  **_options)
45
+ @parent = parent
46
+ # parent_id should be removed in the next major version bump. It has been
47
+ # replaced with passing the actual parent in. This is kept for backwards
48
+ # compatability
44
49
  @parent_id = parent_id
45
50
  @is_root = is_root
46
51
  @presend_hook = presend_hook
@@ -51,6 +56,7 @@ module Honeycomb
51
56
  self.class.new(trace: trace,
52
57
  builder: builder,
53
58
  context: context,
59
+ parent: self,
54
60
  parent_id: id,
55
61
  sample_hook: sample_hook,
56
62
  presend_hook: presend_hook).tap do |c|
@@ -73,9 +79,14 @@ module Honeycomb
73
79
  send_internal
74
80
  end
75
81
 
82
+ def remove_child(child)
83
+ children.delete child
84
+ end
85
+
76
86
  private
77
87
 
78
88
  attr_reader :event,
89
+ :parent,
79
90
  :parent_id,
80
91
  :children,
81
92
  :builder,
@@ -92,14 +103,7 @@ module Honeycomb
92
103
  end
93
104
 
94
105
  def send_internal
95
- add_field "duration_ms", duration_ms
96
- add_field "trace.trace_id", trace.id
97
- add_field "trace.span_id", id
98
- add_field "meta.span_type", span_type
99
- parent_id && add_field("trace.parent_id", parent_id)
100
- add rollup_fields
101
- add trace.fields
102
- span_type == "root" && add(trace.rollup_fields)
106
+ add_additional_fields
103
107
  send_children
104
108
  sample = true
105
109
  if sample_hook.nil?
@@ -114,6 +118,19 @@ module Honeycomb
114
118
  end
115
119
  @sent = true
116
120
  context.span_sent(self)
121
+
122
+ parent && parent.remove_child(self)
123
+ end
124
+
125
+ def add_additional_fields
126
+ add_field "duration_ms", duration_ms
127
+ add_field "trace.trace_id", trace.id
128
+ add_field "trace.span_id", id
129
+ add_field "meta.span_type", span_type
130
+ parent_id && add_field("trace.parent_id", parent_id)
131
+ add rollup_fields
132
+ add trace.fields
133
+ span_type == "root" && add(trace.rollup_fields)
117
134
  end
118
135
 
119
136
  def send_children
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: honeycomb-beeline
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Holman
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-06-10 00:00:00.000000000 Z
11
+ date: 2020-07-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: libhoney