-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: clean invalid UTF8 from trace field values when generating propagation header #232
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
robbkidd
added
type: bug
Something isn't working
status: oncall
Flagged for awareness from Honeycomb Telemetry Oncall
labels
Oct 2, 2023
Trace context is urlsafe_encoded, so the unmarshal/parse should use the matching urlsafe_decode. Otherwise, there are cases where the encoded UTF8 munges characters rendering the decoded output unparsable as JSON.
Reuse the cleaning logic already in Libhoney.
ajvondrak
reviewed
Oct 3, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @robbkidd! Saves me the PR-slinging. 😄 And looks to have the shape I would expect (though admittedly I'm not scouring this PR for edge cases).
- Style/TrailingCommaInArguments: > Put a comma after the last parameter of a multiline method call. OK. - Style/AccessModifierDeclarations: > module_function should not be inlined in method definitions. Turned off this rule. Sometimes we group, sometimes we inline a symbol reference to a method. We remain flexible.
MikeGoldsmith
approved these changes
Oct 11, 2023
JamieDanielson
added
the
version: bump patch
A PR with release-worthy changes and is backwards-compatible.
label
Oct 11, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
status: oncall
Flagged for awareness from Honeycomb Telemetry Oncall
type: bug
Something isn't working
version: bump patch
A PR with release-worthy changes and is backwards-compatible.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Which problem is this PR solving?
Short description of the changes
Tests to Demonstrate the Problem
MarshalTraceContext
Mixes in the data cleaning logic already present in Libhoney::Cleaner to prepare trace data for JSON serialization.
UnmarshalTraceContext
Testing revealed that decoding trace context would fail to produce a string parseable as JSON if some UTF8 characters were included in the data, even if those characters are valid. Because we encode with urlsafe, we need to decode with urlsafe.
Linting
Sometimes we group methods under "private", sometimes we inline a symbol reference to a method with "module_method". We remain flexible. This rule does not serve us and we do not serve it.