-
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
Add dynamic generation topic capabilities to Kafka output plugin #3177
Comments
Have you considered using the |
@danielnelson the thing with Kafka semantics suppose that you scale with partitions, not separate data using them. So in the end, all the data will end up in a single topic anyway. It is okay if actual data meaning is the same, but if it's coming from totally different services, I'd prefer it to be isolated. In this case, it's not isolated even across partitions, because there will be a number of keys where Moreover, if data volumes differ dramatically from one UPDATE: |
What we have done on other queue outputs, namely amqp, is provide routing based on tags. The code is basically the same as is used for We made a similar change recently in #3170, adding a more extensible format for setting the partition key in Kinesis. In Kinesis it is similar to the routing key in Kafka in that it determines the partition. We could do something like that here, but for topic. It would look someething like:
We would need to keep backwards compatibility if we do this. Let me know what you think. |
@danielnelson Sounds good!
So the backward compatibility will be there, if nothing of above is used, we use plain I'm not sure about corner cases though; with Kinesis, it seems to be logical to use empty partitioning key if user specifies "tag" What do you think? |
That's a really good observation. I think it would be a bad thing to drop the metric, since one of the main reasons you would use kafka is for greater durability. I think the fallback idea could work and makes sense from a backwards compatibility point of view. Perhaps we rename the new option Another possible option would be to either require a prefix, or call the new option |
@danielnelson I personally like the |
Sounds good |
@danielnelson Pushed new PR, as you can see; tests sometimes fail on graphite boolean serialisation, though. (After a few tries I made them pass :) ) So I filed another PR addressing that problem: #3198 |
Added in #3196 |
Feature Request
Proposal:
Kafka output plugin to be able to choose topics dynamically based on metric name.
Current behavior:
Kafka output plugin must be provided with a topic name to produce to explicitly. If user wants to produce different metrics to different topics, he or she must create a number of output Kafka plugin configurations to produce certain metrics filtered by name.
Desired behavior:
It would be nice to have an option which would dynamically choose topic name based on metric name, possibly with a static prefix.
Use case:
It's useful in a highly dynamic environment where an unknown beforehand number of different messages (say from completely different services and/or APIs) may be sent to a telegraf instance's input. To push all of them into a single topic would mean to clutter it, and make the future processing difficult in case that different processing pipelines must be used for different data. To filter them with built-in filter.go capabilities would work, but this option lacks any dynamic, as one would have to add more and more filters for all the metrics one receives. This would also clutter telegraf configuration.
The proposed option would solve this problem.
The text was updated successfully, but these errors were encountered: