honeycomb-beeline 2.1.0 → 2.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +3 -0
- data/Gemfile.lock +1 -1
- data/lib/honeycomb/beeline/version.rb +1 -1
- data/lib/honeycomb/span.rb +26 -9
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8dc063924a92fcf2aa2ce4bbdcd3ab6bb79666a4d6266e957129f57bb131ee77
|
4
|
+
data.tar.gz: 30111f935a4503b82321d30fbf752ff7462951c40c6249357543167d24890130
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 300c4652b990b2365eb4194702c16012c027beb7b13d396b0129d7ebe8a82a6bf848ab221d0158967f0e2c9d4bbc20d91715dae88f96b7d4f63714cdc03099f0
|
7
|
+
data.tar.gz: 546ffeb8520ce66beb3d57223aac4e5131f9b0b0286c90618b11983e8a2821a1e8303ed9faf09a3022564956918a2dad688d8bce6bfa4e185c0e4a253fc72666
|
data/.rubocop.yml
CHANGED
data/Gemfile.lock
CHANGED
data/lib/honeycomb/span.rb
CHANGED
@@ -36,11 +36,16 @@ module Honeycomb
|
|
36
36
|
parse_options(**options)
|
37
37
|
end
|
38
38
|
|
39
|
-
def parse_options(
|
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
|
-
|
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.
|
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-
|
11
|
+
date: 2020-07-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: libhoney
|