honeycomb-beeline 2.4.2 → 2.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/CODEOWNERS +1 -1
- data/.github/dependabot.yml +3 -1
- data/.github/workflows/add-to-project.yml +14 -0
- data/.github/workflows/apply-labels.yml +2 -8
- data/.tool-versions +1 -0
- data/CHANGELOG.md +12 -0
- data/Gemfile.lock +1 -1
- data/lib/honeycomb/beeline/version.rb +1 -1
- data/lib/honeycomb/client.rb +38 -13
- data/lib/honeycomb/configuration.rb +6 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8dfad7bddebd49b8645b61389e74035626a0cc817d5fc7ea9e51ab17cb571584
|
4
|
+
data.tar.gz: eadf7a28b41ddb6437e0e5a2c0824c2a2cf67fbf36a95bc18f77ad03b4f74306
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7c6204f46a27e4a3af3bf5d2d173fdb4d06f820ecf76dd2ed84d0de52aca83fb155190075b244ee6ab7e811c93927874ae51d36cc117b018de995ad5aeb76f40
|
7
|
+
data.tar.gz: 175c355b5a5833bfd68b17a281fc2d71f0321f7c708e339b03090b367d64d7a6c9294ed8afcc84d5f538b6c80644f9c26488475962903a2364bb6ab0e7ee93f8
|
data/.github/CODEOWNERS
CHANGED
data/.github/dependabot.yml
CHANGED
@@ -0,0 +1,14 @@
|
|
1
|
+
name: Apply project management flow
|
2
|
+
on:
|
3
|
+
issues:
|
4
|
+
types: [opened]
|
5
|
+
pull_request_target:
|
6
|
+
types: [opened]
|
7
|
+
jobs:
|
8
|
+
project-management:
|
9
|
+
runs-on: ubuntu-latest
|
10
|
+
name: Apply project management flow
|
11
|
+
steps:
|
12
|
+
- uses: honeycombio/oss-management-actions/projects@v1
|
13
|
+
with:
|
14
|
+
ghprojects-token: ${{ secrets.GHPROJECTS_TOKEN }}
|
@@ -1,16 +1,10 @@
|
|
1
1
|
name: Apply project labels
|
2
|
-
|
3
|
-
on:
|
4
|
-
- issues
|
5
|
-
- label
|
6
|
-
- pull_request_target
|
7
|
-
- pull_request
|
8
|
-
|
2
|
+
on: [issues, pull_request, label]
|
9
3
|
jobs:
|
10
4
|
apply-labels:
|
11
5
|
runs-on: ubuntu-latest
|
12
6
|
name: Apply common project labels
|
13
7
|
steps:
|
14
|
-
- uses: honeycombio/
|
8
|
+
- uses: honeycombio/oss-management-actions/labels@v1
|
15
9
|
with:
|
16
10
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
data/.tool-versions
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby 2.7.2
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
# beeline-ruby changelog
|
2
2
|
|
3
|
+
## 2.5.0 2021-07-16
|
4
|
+
|
5
|
+
### Added
|
6
|
+
|
7
|
+
- Allow backtrace to be sent with errors (#160) | [@lirossarvet](https://github.com/lirossarvet)
|
8
|
+
|
9
|
+
### Maintenance
|
10
|
+
|
11
|
+
- Updates Github Action Workflows (#159) | [@bdarfler](https://github.com/bdarfler)
|
12
|
+
- Adds dependabot label (#158) | [@bdarfler](https://github.com/bdarfler)
|
13
|
+
- Switches CODEOWNERS to telemetry-team (#157) | [@bdarfler](https://github.com/bdarfler)
|
14
|
+
|
3
15
|
## 2.4.2 2021-06-25
|
4
16
|
|
5
17
|
### Fixes
|
data/Gemfile.lock
CHANGED
data/lib/honeycomb/client.rb
CHANGED
@@ -38,6 +38,7 @@ module Honeycomb
|
|
38
38
|
parser_hook: configuration.http_trace_parser_hook,
|
39
39
|
propagation_hook: configuration.http_trace_propagation_hook,
|
40
40
|
}
|
41
|
+
@error_backtrace_limit = configuration.error_backtrace_limit.to_i
|
41
42
|
|
42
43
|
configuration.after_initialize(self)
|
43
44
|
|
@@ -47,16 +48,7 @@ module Honeycomb
|
|
47
48
|
end
|
48
49
|
|
49
50
|
def start_span(name:, serialized_trace: nil, **fields)
|
50
|
-
|
51
|
-
Trace.new(serialized_trace: serialized_trace,
|
52
|
-
builder: libhoney.builder,
|
53
|
-
context: context,
|
54
|
-
**@additional_trace_options)
|
55
|
-
else
|
56
|
-
context.current_span.create_child
|
57
|
-
end
|
58
|
-
|
59
|
-
current_span = context.current_span
|
51
|
+
current_span = new_span_for_context(serialized_trace: serialized_trace)
|
60
52
|
|
61
53
|
fields.each do |key, value|
|
62
54
|
current_span.add_field(key, value)
|
@@ -69,8 +61,8 @@ module Honeycomb
|
|
69
61
|
begin
|
70
62
|
yield current_span
|
71
63
|
rescue StandardError => e
|
72
|
-
current_span
|
73
|
-
|
64
|
+
add_exception_data(current_span, e)
|
65
|
+
|
74
66
|
raise e
|
75
67
|
ensure
|
76
68
|
current_span.send
|
@@ -99,6 +91,39 @@ module Honeycomb
|
|
99
91
|
|
100
92
|
private
|
101
93
|
|
102
|
-
attr_reader :context
|
94
|
+
attr_reader :context, :error_backtrace_limit
|
95
|
+
|
96
|
+
def new_span_for_context(serialized_trace:)
|
97
|
+
if context.current_trace.nil?
|
98
|
+
Trace.new(
|
99
|
+
serialized_trace: serialized_trace,
|
100
|
+
builder: libhoney.builder,
|
101
|
+
context: context,
|
102
|
+
**@additional_trace_options,
|
103
|
+
)
|
104
|
+
else
|
105
|
+
context.current_span.create_child
|
106
|
+
end
|
107
|
+
|
108
|
+
context.current_span
|
109
|
+
end
|
110
|
+
|
111
|
+
def add_exception_data(span, exception)
|
112
|
+
span.add_field("error", exception.class.name)
|
113
|
+
span.add_field("error_detail", exception.message)
|
114
|
+
|
115
|
+
return if error_backtrace_limit <= 0
|
116
|
+
|
117
|
+
span.add_field(
|
118
|
+
"error_backtrace",
|
119
|
+
exception
|
120
|
+
.backtrace
|
121
|
+
.take(error_backtrace_limit)
|
122
|
+
.join("\n")
|
123
|
+
.encode("UTF-8", invalid: :replace, undef: :replace, replace: "�"),
|
124
|
+
)
|
125
|
+
span.add_field("error_backtrace_limit", error_backtrace_limit)
|
126
|
+
span.add_field("error_backtrace_total_length", exception.backtrace.length)
|
127
|
+
end
|
103
128
|
end
|
104
129
|
end
|
@@ -12,12 +12,14 @@ module Honeycomb
|
|
12
12
|
:debug
|
13
13
|
|
14
14
|
attr_writer :service_name, :client, :host_name
|
15
|
+
attr_reader :error_backtrace_limit
|
15
16
|
|
16
17
|
def initialize
|
17
18
|
@write_key = ENV["HONEYCOMB_WRITEKEY"]
|
18
19
|
@dataset = ENV["HONEYCOMB_DATASET"]
|
19
20
|
@service_name = ENV["HONEYCOMB_SERVICE"]
|
20
21
|
@debug = ENV.key?("HONEYCOMB_DEBUG")
|
22
|
+
@error_backtrace_limit = 0
|
21
23
|
@client = nil
|
22
24
|
end
|
23
25
|
|
@@ -25,6 +27,10 @@ module Honeycomb
|
|
25
27
|
@service_name || dataset
|
26
28
|
end
|
27
29
|
|
30
|
+
def error_backtrace_limit=(val)
|
31
|
+
@error_backtrace_limit = Integer(val)
|
32
|
+
end
|
33
|
+
|
28
34
|
def client
|
29
35
|
options = {}.tap do |o|
|
30
36
|
o[:writekey] = write_key
|
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.
|
4
|
+
version: 2.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Holman
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-07-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: libhoney
|
@@ -253,12 +253,14 @@ files:
|
|
253
253
|
- ".editorconfig"
|
254
254
|
- ".github/CODEOWNERS"
|
255
255
|
- ".github/dependabot.yml"
|
256
|
+
- ".github/workflows/add-to-project.yml"
|
256
257
|
- ".github/workflows/apply-labels.yml"
|
257
258
|
- ".gitignore"
|
258
259
|
- ".overcommit.yml"
|
259
260
|
- ".rspec"
|
260
261
|
- ".rubocop.yml"
|
261
262
|
- ".ruby-version"
|
263
|
+
- ".tool-versions"
|
262
264
|
- Appraisals
|
263
265
|
- CHANGELOG.md
|
264
266
|
- CODE_OF_CONDUCT.md
|