Repository navigation
fix(event): omit event tags that cannot be serialized to JSON - #463
Open
Alex Castillo González (pcbeingused333) wants to merge 1 commit into
Open
Alex Castillo González (pcbeingused333) wants to merge 1 commit into
Alex Castillo González (pcbeingused333) wants to merge 1 commit into
Conversation
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Trackcopies the caller's event tags into the conversion event unchanged. A tag with no JSON representation (aNaNor±Inffloat, also when nested in a map or slice, or a func/chan) makesjson.Marshalfail for the whole log event.QueueEventDispatchertreats that as a dispatch failure: it retries, gives up, and leaves the event at the head of its queue. Every later flush starts from that same event, so no later impression or conversion is sent.Root cause
createConversionEventassignseventTagswithout checking them.HTTPRequester.Postreturns the marshal error, andQueueEventDispatcher.flushEventsonly removes an event after a successful dispatch.valuewas affected too:getTagValueacceptsNaN, so it was also copied intoConversion.Value.Fix
Tags that cannot be marshalled are left out of the conversion event, with a warning naming each one.
revenueandvalueare read from the filtered tags. The caller's map is not modified, and the same map instance is passed through when there is nothing to remove. Serializable tags are unchanged.Test
TestCreateConversionEventOmitsUnserializableEventTagscoversNaN,±Inf, a nestedNaNand a func next to valid tags, and checks that the resulting batch marshals. It fails before the change and passes after it.go test ./pkg/event/ ./pkg/client/passes.This change was prepared with the help of an AI coding assistant.