keda icon indicating copy to clipboard operation
keda copied to clipboard

More flexible Kafka topic configuration

Open loicmathieu opened this issue 3 years ago • 12 comments

Proposal

Today, Kafka scaler only allow to scale based on the lag of one topic.

A lot of streaming applications uses multiple topics, using the Kafka scaler can be cumbersome if using tens of topics, or a regex of topics.

Multiple improvements can be added if the underlying Kafka client support them to configure multiple topics wich lags will be sumed:

  • Configuring a list of topics
  • Configuring a topic regex
  • Taking into accound the lag of all topics of the configured consumer group

Use-Case

No response

Anything else?

No response

loicmathieu avatar Jan 06 '22 17:01 loicmathieu

Taking into accound the lag of all topics of the configured consumer group

Just seen this one is handled here : https://github.com/kedacore/keda/pull/2409, great ;) But I still think it would be great to have the other capabilities.

loicmathieu avatar Jan 06 '22 17:01 loicmathieu

  • Configuring a list of topics
  • Configuring a topic regex

Our current approach for all scalers is to add multiple triggers in your ScaledObject/Job. This should work for your scenario as well given it starts scaling as soon as one of them meets the criteria.

tomkerkhove avatar Jan 07 '22 06:01 tomkerkhove

@tomkerkhove some typical Kafka deployment involves multiple topic, for eg one topic by country. So you usually use a regex. And configuring hundreds of scaler is not very practical.

Moreover, it's different to have 100 scaler with a max lag of 100 and 1 scaler with a global lag of 10000, the scaler behaviour will not be the same.

loicmathieu avatar Jan 07 '22 08:01 loicmathieu

I agree that a list of topic can be replaced by multiple scalers but not the usage of a regex (moreover, regex target topics can be un-known at build time).

loicmathieu avatar Jan 07 '22 08:01 loicmathieu

Regex is not a bad idea imho (btw this is implemented for RabbitMQ scaler).

@loicmathieu would you be interested to draft some POC?

zroubalik avatar Jan 07 '22 08:01 zroubalik

@zroubalik well I would love to but I'm pretty new to Go and the Sarama client didn't allow pattern based consumption OOTB so it may not be a trivial implementation. If nobody else wanted to work on it I can give it a try but I'm pretty busy these days so it will not be soon.

loicmathieu avatar Jan 07 '22 08:01 loicmathieu

@loicmathieu ok, so let's keep this open for the community.

zroubalik avatar Jan 07 '22 09:01 zroubalik

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Mar 08 '22 09:03 stale[bot]

This issue has been automatically closed due to inactivity.

stale[bot] avatar Mar 15 '22 10:03 stale[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar May 15 '22 08:05 stale[bot]

This issue has been automatically closed due to inactivity.

stale[bot] avatar May 22 '22 08:05 stale[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jul 22 '22 13:07 stale[bot]