in_forward: Accept metadata on encapsulated timestamps#5411
Conversation
|
No sure the policy of backporting but this incompatibility change is needed to handle in maintained Fluentd versions as much as possible due to ensuring interoperability. |
|
|
||
| def extract_event_time(time) | ||
| time.is_a?(Array) ? time[0] : time | ||
| end |
There was a problem hiding this comment.
In practical use case, in same event stream, are there mixed event coming from fluentbit?
I mean that [EventTime, Record], [[EventTime, Hash*], Record], [EventTime, Record], ...
I know that based on the specifications, of course, that case is a possible.
There was a problem hiding this comment.
No, it isn't possible to be contaminated. They'll be handled to switch with the retain_metadata_in_forward_mode parameter:
https://github.com/fluent/fluent-bit/blob/master/plugins/out_forward/forward.c#L1794C28-L1794C59
This should be set up with configuration file and not to be changed at runtime.
|
The Forward-mode path works as intended. See: https://github.com/Watson1978/test-fluentd-pr-5411 (fluentd built from this PR + Fluent Bit v5.0.6 with Same input, same fluentd; only
It need to apply the unwrap independently of Also, the two new tests assert only tag and record, so they pass even when the time is wrong. Could we add an assertion on the emitted time? Something like: assert_equal([time, time], d.events.map { |_tag, t, _record| t }) |
8cb5b14 to
817cd86
Compare
|
I implemented to normalize all of the occurrences on forward protocol v1.5 formats. Could you check on it again? |
817cd86 to
fe52d26
Compare
|
I added benchmark scripts to confirm performance regression in Result When we configure Note |
|
The last commit could be optimized for performance: |
|
The latest result is: |
|
The latest result is: Allocated object counts are reduced but the performance should be in-line. |
Signed-off-by: Hiroshi Hatake <hiroshi@chronosphere.io>
13e5b95 to
03f9f96
Compare
Signed-off-by: Hiroshi Hatake <hiroshi@chronosphere.io>
…t streams ingestions Signed-off-by: Hiroshi Hatake <hiroshi@chronosphere.io>
03f9f96 to
c2d251c
Compare
|
I refactored to put the right place to process the events which are enabled for metadata encapsulated timestamps. The latest result is: With Ruby 3.2.2 With Ruby 4.0.5: With this PR, it sometimes became faster than w/o patched version. |
Just ensuring interoperability to accept the default format of forwarded logs which had been changed in Fluent Bit v5.0.5,
we need to extract the encapsulated timestamps inside of the second argument of the forwarded events from Fluent Bit.
With this minimal changes, we enable to process the new format of forwarded events from Fluent Bit.
Related to #5369.
What this PR does / why we need it:
Since Fluent Bit v5.0.5, Fluent Bit core team decided to send metadata within the forwarding events by default.
So, this could decrease the interoperability between Fluentd and Fluent Bit.
This changes covers to improve interoperability of forward protocol between Fluent Bit's out_forward plugin by default representation of msgpack and Fluentd's out_forward plugin accepts format variations.
This is because forward protocol v1.5 insists that the following BNF's 3rd part of the grammar requests to handle on forward plugins:
Then, the event structure inherits the complexity of the changes of matadata information like:
Docs Changes:
No.
Release Note:
Same as title.
Additional Context:
This PR is just ensuring to ingest metadata enabled logs type of events from Fluent Bit to Fluentd.
It's half pathway to handle complete processing of metadata in forward protocol.