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.
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
loki_out: add stuctured_metadata_map_keys #9530
base: master
Are you sure you want to change the base?
loki_out: add stuctured_metadata_map_keys #9530
Changes from all commits
42f0b3f
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
I'd probably add a
build
section as well and comment out one or the other just to show we can either compile or use the latest.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.
like this?:
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.
no need for pull_policy and I'd just leave it commented out once you've tested it - main thing is it allows people to see how to build vs pull
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.
This seems to be working locally now
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.
If you mount this to the default location then you can also remove the
command
override - although that only is true currently if it is the legacy TOML format config.e.g. this would mean no need to have a
command
:- ./config/fluent-bit_loki_out-structured_metadata_map.conf:/fluent-bit/etc/fluent-bit.conf
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.
Is this preferred? I find the yaml easier to read.
I think I read somewhere that you're going to make the yaml config the default? Would this end up diverging between the 3.x branch and 4.x?
Happy to change this though if that's what you want 😄
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.
No, this is fine and yeah we will be moving to YAML by default for 4.0.
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.
This essentially tries to follow the flow of the proceeding
pack_kv
function.Do you need a more detailed spec of what exactly this is supposed to be doing?
It should implement the proposal descibed in the FR #9463
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.
flb_ra_* API do not use msgpack-c return codes like
MSGPACK_UNPACK_CONTINUE
, need to check the return values and adjust itThere 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.
I'm a bit confused as to the meaning of the return code from
flb_ra_get_kv_pair
. I see from the source it is commented that this shouldWhere
FLB_TRUE
is1
andFLB_FALSE
is0
However, actually reading the code, if this doesn't hit the
FLB_FALSE
code path, it actually just returns whatever the following call toflb_ra_key_value_get
returns, and functionflb_ra_key_value_get
actually seems to return0
for okay, and-1
for not okay..It looks like we are getting return codes as follows:
flb_ra_key_value_get
and return0
$$
- this will returnFLB_FALSE
(also0
) viaget_ra_parser
.out_val
and finally logNo valid map data found for key $
(test caseflb_test_structured_metadata_map_invalid_ra_key
)$missing_map
which doesn't reference anything - this will delegate toflb_ra_key_value_get
and return-1
(test casestructured_metadata_map_single_missing_map
)It seems like the main option here to to test for not equal to
-1
, and then checkout_val
.Otherwise, we have to change how
flb_ra_get_kv_pair
works to agree with its comment, which I assume would break some important things elsewhere?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.
@edsiper Any thoughts on this? I believe checking
!= -1
is the best we can do here.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.
I believe this works as expected.
The intention is, if we try to add an entry to the structured_metadata with the same key twice (first from the new
structured_metadata_map_keys
, then from the existingstructured_metadata
), then the second entry should "win" and overrwite the first.I am assuming msgpack works this way. But maybe I actually need to do some kind of explicit check, and only add a new entry where there is not already one for a given key?