You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Update Forward Protocol Specification for zstd compression support #4758
### CompressedPackedForward Mode
-It carries a series of events as a msgpack binary, compressed by gzip, on a single request. The supported compression algorithm is only gzip.+It carries a series of events as a msgpack binary, compressed by gzip or zstd, on a single request.-- `entries` is a gzipped binary chunk of `MessagePackEventStream`, which MAY be a concatenated binary of multiple gzip binary strings.-- Client MUST send an option with `compressed` key with the value `gzip`.-- Client MUST send a gzipped chunk as msgpack `bin` format.+- `entries` is a gzip/zstd binary chunk of `MessagePackEventStream`, which MAY be a concatenated binary of multiple gzip/zstd binary strings.+- Client MUST send an option with `compressed` key with the value `gzip` or `zstd`.+- Client MUST send a gzip/zstd chunk as msgpack `bin` format.
- Server MUST accept `bin` format.
- Server MAY decompress and decode individual events on demand but MAY NOT do right after request arrival. It means it MAY costs less, compared to `Forward` mode, when decoding is not needed by any plugins.
- Server MAY just ignore any options given.
- `size`: Clients MAY send the `size` option to show the number of event records in an entries by an integer as a value. Server can know the number of events without unpacking entries (especially for PackedForward and CompressedPackedForward mode).
- `chunk`: Clients MAY send the `chunk` option to confirm the server receives event records. The value is a string of Base64 representation of 128 bits `unique_id` which is an ID of a set of events.
-- `compressed`: Clients MUST send the `compressed` option with value `gzip` to tell servers that entries is `CompressedPackedForward`. Other values will be ignored.+- `compressed`: Clients MUST send the `compressed` option with value `gzip` or `zstd` to tell servers that entries is `CompressedPackedForward`. Other values will be ignored.
```json
{"chunk": "p8n9gmxTQVC8/nh2wlKKeQ==", "size": 4097}
-- entries is a gzipped binary chunk of MessagePackEventStream, which MAY be a concatenated binary of multiple gzip binary strings.
-- Client MUST send an option with compressed key with the value gzip.
-- Client MUST send a gzipped chunk as msgpack bin format.
+- entries is a gzip/zstd binary chunk of MessagePackEventStream, which MAY be a concatenated binary of multiple gzip/zstd binary strings.
+- Client MUST send an option with compressed key with the value gzip or zstd.
+- Client MUST send a gzip/zstd chunk as msgpack bin format.
However, I have a question for these sentences. Currently, we're able to decompress compressed chunks one-by-one. So, in paper, we are also able to take turns to decompress gzip compressed chunks and zstd compressed chunks.
Is this specification needed to point out explicitly in the revised specification?
@cosmo0920 are u pointing to the case where different sources send different type of compressed chunks?
Incase of forward protocol the message itself has the compression type so the decompression happens wrt the metadata of the compressed chunk.
Yes, different sources use the same in_forward case. This is surely occurred because Fluentd is able to be used as an aggregator which will collect the different Fluentd instances with pointing the same forward endpoint. So, probably we need to clarify on it even if the implementation already does.
Client SHOULD NOT send zstd to the server that doesn't support zstd format.
Or, for now, we will make zstd available as an exprimenatal feature on the Fluentd side, and note in the documentation that it is an experimental feature that cannot be used unless the server supports it.
First, we make Fluentd handle zstd internally and revert Fluentd's out_forward zstd feature to avoid violating the protocol.
When Fluent Bit is ready to support zstd, we will update the protocol and restore Fluentd's out_forward zstd feature.
Reverting zstd compression support is not working for us. Just displaying as a warning log to tell: "This is experimental feature and not standardized yet" or similar message should be enough.
I mean, adding zstd compression with upgrading mechanism could make seamless upgrading to use zstd compression in forward protocol. However, we didn't find a suitable way to prevent unsupported errors on "fluent servers".
So, just leaving as an experimental feature should be enough on Fluent Bit side.
We will wait for Fluent Bit to support zstd, and then update the protocol.
We're also waiting for supporting observability payloads on Fluentd. :)
It means that cmetrics binding for Ruby which is called cmetrics2 for handling incompatibilities of cmetrics msgpack payload between v0.3 and v0.5 or later.
Plus, adding a capabilities to ingest those of msgpack payloads on Fluentd.
Currently, we converted those of payloads as logs mode and sent them into Fluentd.
Oh,,, thanks!
Sorry, I don’t fully understand that part.
You're saying that Fluentd doesn't support the v1.5 protocol yet, right?
That's something Fluentd needs to address.
We should start by creating an issue.
FYI: We're starting to process this feature in Fluent Bit side. The thing is, Fluent Bit has strict rules of size of chunks. So, we need to implement streaming style of decompression methods and use it at in_forward plugin.
This is because our assumed environments are under containerized environments with strict rule of resource limits.
So, it could take a bit of longer than we firstly expected to implement zstd decompression and compression in Fluent Bit side.
Activity
daipom commentedon Jan 6, 2025
I propose changes to the following two sections.
https://github.com/fluent/fluentd/wiki/Forward-Protocol-Specification-v1.5#compressedpackedforward-mode
https://github.com/fluent/fluentd/wiki/Forward-Protocol-Specification-v1.5#option
daipom commentedon Jan 6, 2025
Does this revision require a voting process?
Athishpranav2003 commentedon Jan 6, 2025
The changes suggested here looks good to me.
daipom commentedon Jan 7, 2025
If there are no objections, I would like to set it to v1.6 with the agreement of both Fluentd and Fluent Bit maintainers.
@cosmo0920
Could you please check #4758 (comment) ?
ashie commentedon Jan 7, 2025
LGTM
cosmo0920 commentedon Jan 8, 2025
This would be good:
However, I have a question for these sentences. Currently, we're able to decompress compressed chunks one-by-one. So, in paper, we are also able to take turns to decompress gzip compressed chunks and zstd compressed chunks.
Is this specification needed to point out explicitly in the revised specification?
Athishpranav2003 commentedon Jan 8, 2025
@cosmo0920 are u pointing to the case where different sources send different type of compressed chunks?
Incase of forward protocol the message itself has the compression type so the decompression happens wrt the metadata of the compressed chunk.
cosmo0920 commentedon Jan 8, 2025
Yes, different sources use the same in_forward case. This is surely occurred because Fluentd is able to be used as an aggregator which will collect the different Fluentd instances with pointing the same forward endpoint. So, probably we need to clarify on it even if the implementation already does.
Athishpranav2003 commentedon Jan 8, 2025
@cosmo0920
https://github.com/fluent/fluentd/pull/4657/files#diff-71dd20388a1f90eaec72fb257002fc6d44a497d457821d0c105acc0510844be1R314
In this line the compression format is also used as an argument during decompression. I guess this should answer your question.
29 remaining items
daipom commentedon Jan 23, 2025
Or, add #4758 (comment) something like the following:
Or, for now, we will make zstd available as an exprimenatal feature on the Fluentd side, and note in the documentation that it is an experimental feature that cannot be used unless the server supports it.
Athishpranav2003 commentedon Jan 23, 2025
Even i strongly feel that its more suitable to put this as an important note and leave it to the responsiblity of the users
cosmo0920 commentedon Jan 23, 2025
Reverting zstd compression support is not working for us. Just displaying as a warning log to tell: "This is experimental feature and not standardized yet" or similar message should be enough.
I mean, adding zstd compression with upgrading mechanism could make seamless upgrading to use zstd compression in forward protocol. However, we didn't find a suitable way to prevent unsupported errors on "fluent servers".
So, just leaving as an experimental feature should be enough on Fluent Bit side.
daipom commentedon Jan 23, 2025
@Athishpranav2003 @cosmo0920
OK! Thanks!
Let's note in the document and log message!
out_forward: add warning for zstd as experimental
out_forward: add warning for zstd as experimental (#4896)
daipom commentedon Jun 27, 2025
Done!
daipom commentedon Jun 27, 2025
We will wait for Fluent Bit to support zstd, and then update the protocol.
cosmo0920 commentedon Jun 27, 2025
We're also waiting for supporting observability payloads on Fluentd. :)
It means that cmetrics binding for Ruby which is called cmetrics2 for handling incompatibilities of cmetrics msgpack payload between v0.3 and v0.5 or later.
Plus, adding a capabilities to ingest those of msgpack payloads on Fluentd.
Currently, we converted those of payloads as logs mode and sent them into Fluentd.
daipom commentedon Jun 27, 2025
Oh,,, thanks!
Sorry, I don’t fully understand that part.
You're saying that Fluentd doesn't support the v1.5 protocol yet, right?
That's something Fluentd needs to address.
We should start by creating an issue.
cosmo0920 commentedon Jun 27, 2025
Yes. That's why we need to treat that observability payloads should be treated as optional stuffs in v1.5.
cosmo0920 commentedon Aug 6, 2025
FYI: We're starting to process this feature in Fluent Bit side. The thing is, Fluent Bit has strict rules of size of chunks. So, we need to implement streaming style of decompression methods and use it at in_forward plugin.
This is because our assumed environments are under containerized environments with strict rule of resource limits.
So, it could take a bit of longer than we firstly expected to implement zstd decompression and compression in Fluent Bit side.