honeycomb-beeline 3.0.0 → 3.1.0
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/.circleci/config.yml +2 -2
- data/.github/CODEOWNERS +1 -1
- data/.github/release.yml +3 -1
- data/.github/workflows/add-to-project-v2.yml +1 -1
- data/.gitignore +3 -0
- data/.rubocop.yml +1 -5
- data/CHANGELOG.md +33 -0
- data/DEVELOPING.md +31 -0
- data/RELEASING.md +8 -4
- data/honeycomb-beeline.gemspec +1 -1
- data/lib/honeycomb/beeline/version.rb +1 -1
- data/lib/honeycomb/client.rb +1 -5
- data/lib/honeycomb/configuration.rb +1 -1
- data/lib/honeycomb/propagation/default_modern.rb +0 -2
- data/lib/honeycomb/propagation/honeycomb.rb +25 -11
- data/lib/honeycomb/propagation/honeycomb_modern.rb +18 -6
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '08af02ad5ff2f13cb62cb4e8fd2db744ef4c6300d47089c671db811c64088535'
|
4
|
+
data.tar.gz: 7f2367a5e51c0e4aec9ee8c6724b60cd7b97148960fbeec077c7b5fb46be9883
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4ab8b1dd5cffe6067248ac5d1d5aaa1a1b66feb5b9f335d52cb48aa004c1b60af9857a172f9b729e4d753dbfe58b624ce90e33648afde210b66073fcddae9456
|
7
|
+
data.tar.gz: 6216d0c4eef4b5c20cb922d92e713c813f377a25542b2b7db26fb9553bab59bb34f573d66a35e324d68c22e23782482985a7618e02ee1c4d07462e8451d43415
|
data/.circleci/config.yml
CHANGED
data/.github/CODEOWNERS
CHANGED
data/.github/release.yml
CHANGED
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
@@ -36,11 +36,7 @@ Metrics/ParameterLists:
|
|
36
36
|
Max: 6
|
37
37
|
|
38
38
|
Style/AccessModifierDeclarations:
|
39
|
-
|
40
|
-
- lib/honeycomb/propagation/aws.rb
|
41
|
-
- lib/honeycomb/propagation/w3c.rb
|
42
|
-
- lib/honeycomb/propagation/honeycomb.rb
|
43
|
-
- lib/honeycomb/propagation/default.rb
|
39
|
+
Enabled: false
|
44
40
|
|
45
41
|
Style/FrozenStringLiteralComment:
|
46
42
|
EnforcedStyle: always
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,38 @@
|
|
1
1
|
# beeline-ruby changelog
|
2
2
|
|
3
|
+
## 3.1.0 2024-03-07
|
4
|
+
|
5
|
+
⚠️ Minimum libhoney version is now 2.3.0 ⚠️
|
6
|
+
|
7
|
+
Previously the minimum libhoney was 1.14.2. Backwards-incompatible changes in [libhoney 2.0.0](https://github.com/honeycombio/libhoney-rb/releases/tag/v2.0.0):
|
8
|
+
|
9
|
+
* Removal of the deprecated Array input for http proxy configuration.
|
10
|
+
* If you are using the Beeline in services that must send web traffic through an out-going proxy, see [libhoney 1.x proxy_config deprecation warning](https://github.com/honeycombio/libhoney-rb/blob/v1.21.0/lib/libhoney/client.rb#L273-L276) for recommended configuration.
|
11
|
+
* Drop support for Ruby versions 2.2 and 2.3.
|
12
|
+
* Beeline Ruby already requires a minimum Ruby 2.5.
|
13
|
+
|
14
|
+
### Enhancements
|
15
|
+
|
16
|
+
- feat: support classic ingest keys (#238) | Robb Kidd
|
17
|
+
|
18
|
+
### Maintenance
|
19
|
+
|
20
|
+
- maint: add labels to release.yml for auto-generated grouping (#239) | Jamie Danielson
|
21
|
+
- maint: update codeowners to pipeline-team (#237) | Jamie Danielson
|
22
|
+
- maint: update codeowners to pipeline (#236) | Jamie Danielson
|
23
|
+
|
24
|
+
## 3.0.1 2023-10-12
|
25
|
+
|
26
|
+
### Fixed
|
27
|
+
|
28
|
+
- fix: clean invalid UTF8 from trace field values when generating propagation header (#232) | Robb Kidd
|
29
|
+
|
30
|
+
### Maintenance
|
31
|
+
|
32
|
+
- maint: add local dev notes and fix example (#233) | Jamie Danielson
|
33
|
+
- ci: move nightly to weekly (#230) | Vera Reynolds
|
34
|
+
- ci: AWS specs updated to use include() instead of match() (#229) | Robb Kidd
|
35
|
+
|
3
36
|
## 3.0.0 2023-06-08
|
4
37
|
|
5
38
|
### ⚠️ Breaking Changes ⚠️
|
data/DEVELOPING.md
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
# Local Development
|
2
|
+
|
3
|
+
## Requirements
|
4
|
+
|
5
|
+
Ruby: <https://www.ruby-lang.org/en/documentation/installation/>
|
6
|
+
|
7
|
+
Rake:
|
8
|
+
|
9
|
+
```shell
|
10
|
+
gem install rake
|
11
|
+
```
|
12
|
+
|
13
|
+
## Install dependencies
|
14
|
+
|
15
|
+
```shell
|
16
|
+
bundle install
|
17
|
+
```
|
18
|
+
|
19
|
+
## Run Tests
|
20
|
+
|
21
|
+
To run all tests:
|
22
|
+
|
23
|
+
```shell
|
24
|
+
bundle exec rake test
|
25
|
+
```
|
26
|
+
|
27
|
+
To run individual tests:
|
28
|
+
|
29
|
+
```shell
|
30
|
+
bundle exec rake test TEST=spec/honeycomb/trace_spec.rb
|
31
|
+
```
|
data/RELEASING.md
CHANGED
@@ -1,9 +1,13 @@
|
|
1
1
|
# Releasing
|
2
2
|
|
3
|
-
- Update the version number in `lib/honeycomb/beeline/version`.
|
4
|
-
- Update `CHANGELOG.md` with the changes since the last release.
|
3
|
+
- Update the version number in `lib/honeycomb/beeline/version.rb`.
|
4
|
+
- Update `CHANGELOG.md` with the changes since the last release. Consider automating with a command such as these two:
|
5
|
+
- `git log $(git describe --tags --abbrev=0)..HEAD --no-merges --oneline > new-in-this-release.log`
|
6
|
+
- `git log --pretty='%C(green)%d%Creset- %s | %an'`
|
5
7
|
- Commit changes, push, and open a release preparation pull request for review.
|
6
8
|
- Once the pull request is merged, fetch the updated `main` branch.
|
7
|
-
- Apply a tag for the new version on the merged commit
|
8
|
-
- Push the
|
9
|
+
- Apply a tag for the new version on the merged commit (e.g. `git tag -a v2.3.1 -m "v2.3.1"`)
|
10
|
+
- Push the tag upstream (this will kick off the release pipeline in CI) e.g. `git push origin v2.3.1`
|
11
|
+
- Ensure that there is a draft GitHub release created as part of CI publish steps (this will also publish to Gems registry).
|
12
|
+
- Click "generate release notes" in GitHub for full changelog notes and any new contributors
|
9
13
|
- Publish the draft release in GitHub.
|
data/honeycomb-beeline.gemspec
CHANGED
@@ -37,7 +37,7 @@ Gem::Specification.new do |spec|
|
|
37
37
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
38
38
|
spec.require_paths = ["lib"]
|
39
39
|
|
40
|
-
spec.add_dependency "libhoney", ">=
|
40
|
+
spec.add_dependency "libhoney", ">= 2.3.0"
|
41
41
|
|
42
42
|
spec.add_development_dependency "appraisal"
|
43
43
|
spec.add_development_dependency "bump"
|
data/lib/honeycomb/client.rb
CHANGED
@@ -33,7 +33,7 @@ module Honeycomb
|
|
33
33
|
@libhoney.add_field "service.name", configuration.service_name
|
34
34
|
@context = Context.new
|
35
35
|
|
36
|
-
@context.classic =
|
36
|
+
@context.classic = configuration.classic?
|
37
37
|
|
38
38
|
@additional_trace_options = {
|
39
39
|
presend_hook: configuration.presend_hook,
|
@@ -128,9 +128,5 @@ module Honeycomb
|
|
128
128
|
span.add_field("error_backtrace_limit", error_backtrace_limit)
|
129
129
|
span.add_field("error_backtrace_total_length", exception.backtrace.length)
|
130
130
|
end
|
131
|
-
|
132
|
-
def classic_write_key?(write_key)
|
133
|
-
write_key.nil? || write_key.length == 32
|
134
|
-
end
|
135
131
|
end
|
136
132
|
end
|
@@ -3,6 +3,7 @@
|
|
3
3
|
require "base64"
|
4
4
|
require "json"
|
5
5
|
require "uri"
|
6
|
+
require "libhoney/cleaner"
|
6
7
|
|
7
8
|
module Honeycomb
|
8
9
|
# Parsing and propagation for honeycomb trace headers
|
@@ -41,7 +42,7 @@ module Honeycomb
|
|
41
42
|
when "parent_id"
|
42
43
|
parent_span_id = value
|
43
44
|
when "context"
|
44
|
-
Base64.
|
45
|
+
Base64.urlsafe_decode64(value).tap do |json|
|
45
46
|
trace_fields = JSON.parse json
|
46
47
|
rescue JSON::ParserError
|
47
48
|
trace_fields = {}
|
@@ -58,14 +59,17 @@ module Honeycomb
|
|
58
59
|
|
59
60
|
# Serialize trace headers
|
60
61
|
module MarshalTraceContext
|
62
|
+
# for cleaning data in trace fields before serializing to prop header value
|
63
|
+
include Libhoney::Cleaner
|
64
|
+
# promote cleaner instance methods to module methods so that self.to_trace_header can use them
|
65
|
+
module_function :clean_data, :clean_string
|
66
|
+
|
61
67
|
def to_trace_header
|
62
|
-
context = Base64.urlsafe_encode64(JSON.generate(trace.fields)).strip
|
63
|
-
encoded_dataset = URI.encode_www_form_component(builder.dataset)
|
64
68
|
data_to_propogate = [
|
65
|
-
"dataset=#{
|
69
|
+
"dataset=#{encode_dataset(builder.dataset)}",
|
66
70
|
"trace_id=#{trace.id}",
|
67
71
|
"parent_id=#{id}",
|
68
|
-
"context=#{
|
72
|
+
"context=#{encode_trace_fields(trace.fields)}",
|
69
73
|
]
|
70
74
|
"1;#{data_to_propogate.join(',')}"
|
71
75
|
end
|
@@ -77,18 +81,28 @@ module Honeycomb
|
|
77
81
|
end
|
78
82
|
|
79
83
|
def self.to_trace_header(propagation_context)
|
80
|
-
fields = propagation_context.trace_fields
|
81
|
-
context = Base64.urlsafe_encode64(JSON.generate(fields)).strip
|
82
|
-
dataset = propagation_context.dataset
|
83
|
-
encoded_dataset = URI.encode_www_form_component(dataset)
|
84
84
|
data_to_propogate = [
|
85
|
-
"dataset=#{
|
85
|
+
"dataset=#{encode_dataset(propagation_context.dataset)}",
|
86
86
|
"trace_id=#{propagation_context.trace_id}",
|
87
87
|
"parent_id=#{propagation_context.parent_id}",
|
88
|
-
"context=#{
|
88
|
+
"context=#{encode_trace_fields(propagation_context.trace_fields)}",
|
89
89
|
]
|
90
90
|
"1;#{data_to_propogate.join(',')}"
|
91
91
|
end
|
92
|
+
|
93
|
+
def encode_trace_fields(fields)
|
94
|
+
Base64.urlsafe_encode64(
|
95
|
+
JSON.generate(
|
96
|
+
clean_data(fields),
|
97
|
+
),
|
98
|
+
).strip
|
99
|
+
end
|
100
|
+
module_function :encode_trace_fields
|
101
|
+
|
102
|
+
def encode_dataset(dataset)
|
103
|
+
URI.encode_www_form_component(dataset)
|
104
|
+
end
|
105
|
+
module_function :encode_dataset
|
92
106
|
end
|
93
107
|
end
|
94
108
|
end
|
@@ -3,6 +3,7 @@
|
|
3
3
|
require "base64"
|
4
4
|
require "json"
|
5
5
|
require "uri"
|
6
|
+
require "libhoney/cleaner"
|
6
7
|
|
7
8
|
module Honeycomb
|
8
9
|
# Parsing and propagation for honeycomb trace headers
|
@@ -39,7 +40,7 @@ module Honeycomb
|
|
39
40
|
when "parent_id"
|
40
41
|
parent_span_id = value
|
41
42
|
when "context"
|
42
|
-
Base64.
|
43
|
+
Base64.urlsafe_decode64(value).tap do |json|
|
43
44
|
trace_fields = JSON.parse json
|
44
45
|
rescue JSON::ParserError
|
45
46
|
trace_fields = {}
|
@@ -56,12 +57,16 @@ module Honeycomb
|
|
56
57
|
|
57
58
|
# Serialize trace headers
|
58
59
|
module MarshalTraceContext
|
60
|
+
# for cleaning data in trace fields before serializing to prop header value
|
61
|
+
include Libhoney::Cleaner
|
62
|
+
# promote cleaner instance methods to module methods so that self.to_trace_header can use them
|
63
|
+
module_function :clean_data, :clean_string
|
64
|
+
|
59
65
|
def to_trace_header
|
60
|
-
context = Base64.urlsafe_encode64(JSON.generate(trace.fields)).strip
|
61
66
|
data_to_propogate = [
|
62
67
|
"trace_id=#{trace.id}",
|
63
68
|
"parent_id=#{id}",
|
64
|
-
"context=#{
|
69
|
+
"context=#{encode_trace_fields(trace.fields)}",
|
65
70
|
]
|
66
71
|
"1;#{data_to_propogate.join(',')}"
|
67
72
|
end
|
@@ -73,15 +78,22 @@ module Honeycomb
|
|
73
78
|
end
|
74
79
|
|
75
80
|
def self.to_trace_header(propagation_context)
|
76
|
-
fields = propagation_context.trace_fields
|
77
|
-
context = Base64.urlsafe_encode64(JSON.generate(fields)).strip
|
78
81
|
data_to_propogate = [
|
79
82
|
"trace_id=#{propagation_context.trace_id}",
|
80
83
|
"parent_id=#{propagation_context.parent_id}",
|
81
|
-
"context=#{
|
84
|
+
"context=#{encode_trace_fields(propagation_context.trace_fields)}",
|
82
85
|
]
|
83
86
|
"1;#{data_to_propogate.join(',')}"
|
84
87
|
end
|
88
|
+
|
89
|
+
def encode_trace_fields(fields)
|
90
|
+
Base64.urlsafe_encode64(
|
91
|
+
JSON.generate(
|
92
|
+
clean_data(fields),
|
93
|
+
),
|
94
|
+
).strip
|
95
|
+
end
|
96
|
+
module_function :encode_trace_fields
|
85
97
|
end
|
86
98
|
end
|
87
99
|
end
|
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: 3.
|
4
|
+
version: 3.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- The Honeycomb.io Team
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-03-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: libhoney
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 2.3.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 2.3.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: appraisal
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -260,6 +260,7 @@ files:
|
|
260
260
|
- CODE_OF_CONDUCT.md
|
261
261
|
- CONTRIBUTING.md
|
262
262
|
- CONTRIBUTORS.md
|
263
|
+
- DEVELOPING.md
|
263
264
|
- Gemfile
|
264
265
|
- LICENSE
|
265
266
|
- NOTICE
|