awslabs / awslabs/flowgger

LTSV decoder doesn't respect output.ltsv_extra add or replace fields

Open
#39 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Rust
Stars
879
Forks
61
PR merge metrics
No merged PRs in 30d

Description

Found this while writing tests

As for https://github.com/jedisct1/flowgger/wiki/LTSV-Encoder the encoders should support the ability to add or replace, without duplicating tags and fields.

LTSV is not only not overriding it, but get duplicated as the encoding is done by appending data to a String:

https://github.com/awslabs/flowgger/blob/master/src/flowgger/encoder/ltsv_encoder.rs#L41

left: `"some_info:foo\tsome_info:bar\thost:example.org\ttime:1385053862.3072\tmessage:A short message\tfull_message:Backtrace here with more\tlevel:1\tappname:appname\tprocid:44\tmsgid:msg_id"`,
right: `"some_info:bar\thost:example.org\ttime:1385053862.3072\tmessage:A short message\tfull_message:Backtrace here with more\tlevel:1\tappname:appname\tprocid:44\tmsgid:msg_id"`', src/flowgger/encoder/ltsv_encoder.rs:175:9

Contributor guide

Open the contributing guide

Research direction

Start with src/flowgger/encoder/ltsv_encoder.rs, especially the encoding logic near line 41 and the failing assertion near line 175. Run the existing LTSV encoder test, then verify that output.ltsv_extra fields replace matching fields without duplicate tags and that the expected output matches the issue example.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.