-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Support Kafka zstd compression #7123
Comments
@KarstenSchnitter We've upgraded to sarama 1.27.1 in #8289. If you're interested in submitting a PR for Kafka zstd compression that would be great. Otherwise we'll add this to our backlog. |
This is great news. I have not found the time to try that out yet. Shopify/sarama v1.27.1 should support zstd compression out of the box. |
I tested this with 1.17.2 agent today, ZSTD compression set in the output pointing to Kafka running v2.5.0 but the agent would not start and shows Kafka is definitely above this version so not sure where Telegraf plugin is getting the version from. |
This error is generated by sarama when the Kafka consumer version is below 2.1.0. I think it is configured here to be 0.10.2.0:
version , but I cannot find code, that would honour any configured value. If this was the case using a version above 2.1.0 should work.
|
I revisited the configuration of the sarama Kafka client. It parses the [[inputs.kafka_consumer]]
brokers = ["localhost:9092"]
topics = ["telegraf"]
version = "2.1.0"
# further config |
Thanks, I assumed the Sarama code would detect the version and so didn't spot this param. I've tested and it works fine, thanks very much for the help |
Is there any expectation of changing the default from 0.10.2.0 or do we just have to add this override everywhere? I was bitten by this today, enabling zstd compression in a metrics producer, and then being unable to consume the metrics in Telegraf; worse, updating the We've reverted the change but I now have a topic full of un-consumable compressed messages and a big gap in metrics visualisations. |
0.10.2.0 is the Sarama default. It is hard to decide on any other default, since the Kafka version in use is unknown. I have experienced similar problems with Sarama consuming zstd topics outside of Telegraf. Maybe you could try to play around with the |
Kafka has (ok ... purports to have?) excellent bidirectional client/broker version compatibility negotiation. If Telegraf selected a later version in the Sarama config, would Sarama gracefully fall back to earlier API versions if needed, or does this setting force it to use the API version given? Setting |
According to @dnwe in IBM/sarama#1831 the memory inflation issue was addressed in Sarama 1.28.0 - first version of Telegraf with this fix appears to be 1.20.3. |
Description
The Kafka plugins do not support zstd compression. This is due to the used sarama version. It can be fixed by an upgrade of the dependency to versions >1.26.0. Current version is 1.26.1
Proposal:
Upgrade Shopify/sarama to 1.26.1
Current behavior:
telegraf cannot consume or produce Kafka topics with zstd compression
Desired behavior:
telegraf can consume or produce Kafka topics with zstd compression
The text was updated successfully, but these errors were encountered: