honeycomb-beeline 3.0.0 → 3.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +2 -2
- data/.gitignore +3 -0
- data/.rubocop.yml +1 -5
- data/CHANGELOG.md +12 -0
- data/DEVELOPING.md +31 -0
- data/RELEASING.md +8 -4
- data/lib/honeycomb/beeline/version.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 +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6be26f3bc54561c09f8c6c35ab53586a71fd46cbff7a6d926c9e38b4246d9f49
|
4
|
+
data.tar.gz: bd9723d71f943492047ecad4c3634c54520346c6b3bd75a50bfb72498cffb339
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cd27f4f6844b6f691343e9fbdc2ea86b92a7a32e44005510d2e7d2270b0afa56a4ff1d7444608872f01cc053037a971d6c17a68d2548b3d3be34c327ed082989
|
7
|
+
data.tar.gz: fd2ce5459d4a2c2762d3c4caf625d120ae3fa15149ec288ee62c4d1eceb4b01618f66465e2e056684c1e2faebf4dceb1351364987c58e3a371ad037e879f262e
|
data/.circleci/config.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,17 @@
|
|
1
1
|
# beeline-ruby changelog
|
2
2
|
|
3
|
+
## 3.0.1 2023-10-12
|
4
|
+
|
5
|
+
### Fixed
|
6
|
+
|
7
|
+
- fix: clean invalid UTF8 from trace field values when generating propagation header (#232) | Robb Kidd
|
8
|
+
|
9
|
+
### Maintenance
|
10
|
+
|
11
|
+
- maint: add local dev notes and fix example (#233) | Jamie Danielson
|
12
|
+
- ci: move nightly to weekly (#230) | Vera Reynolds
|
13
|
+
- ci: AWS specs updated to use include() instead of match() (#229) | Robb Kidd
|
14
|
+
|
3
15
|
## 3.0.0 2023-06-08
|
4
16
|
|
5
17
|
### ⚠️ 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.
|
@@ -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.0.
|
4
|
+
version: 3.0.1
|
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: 2023-
|
11
|
+
date: 2023-10-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: libhoney
|
@@ -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
|