From 5211cda75fb7971e882daaa897c75fb950c5f657 Mon Sep 17 00:00:00 2001 From: Dao Thanh Tung Date: Thu, 16 Nov 2023 16:14:57 +0000 Subject: [PATCH] Add more logs to debug the output of Sarama `DescribeTopics` method (#5141) Signed-off-by: dttung2905 --- CHANGELOG.md | 1 + pkg/scalers/apache_kafka_scaler.go | 2 +- pkg/scalers/kafka_scaler.go | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d230956e6a4..b2950472e5e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -64,6 +64,7 @@ Here is an overview of all new **experimental** features: - **General**: Support TriggerAuthentication properties from ConfigMap ([#4830](https://github.com/kedacore/keda/issues/4830)) - **Hashicorp Vault**: Add support to get secret that needs write operation (e.g. pki) ([#5067](https://github.com/kedacore/keda/issues/5067)) - **Kafka Scaler**: Ability to set upper bound to the number of partitions with lag ([#3997](https://github.com/kedacore/keda/issues/3997)) +- **Kafka Scaler**: Add more logging to check Sarama DescribeTopics method ([#5102](https://github.com/kedacore/keda/issues/5102)) - **Kafka Scaler**: Add support for Kerberos authentication (SASL / GSSAPI) ([#4836](https://github.com/kedacore/keda/issues/4836)) - **Prometheus Metrics**: Introduce paused ScaledObjects in Prometheus metrics ([#4430](https://github.com/kedacore/keda/issues/4430)) - **Pulsar Scaler**: support endpointParams in pulsar oauth ([#5069](https://github.com/kedacore/keda/issues/5069)) diff --git a/pkg/scalers/apache_kafka_scaler.go b/pkg/scalers/apache_kafka_scaler.go index b06e71bdcb1..5d70d2ee660 100644 --- a/pkg/scalers/apache_kafka_scaler.go +++ b/pkg/scalers/apache_kafka_scaler.go @@ -426,7 +426,7 @@ func (s *apacheKafkaScaler) getTopicPartitions(ctx context.Context) (map[string] if err != nil { return nil, fmt.Errorf("error getting metadata: %w", err) } - s.logger.V(4).Info(fmt.Sprintf("Listed topics %v", metadata.Topics)) + s.logger.V(1).Info(fmt.Sprintf("Listed topics %v", metadata.Topics)) if len(s.metadata.topic) == 0 { // in case of empty topic name, we will get all topics that the consumer group is subscribed to diff --git a/pkg/scalers/kafka_scaler.go b/pkg/scalers/kafka_scaler.go index 7d198c11eda..6c58e5efb9b 100644 --- a/pkg/scalers/kafka_scaler.go +++ b/pkg/scalers/kafka_scaler.go @@ -594,6 +594,9 @@ func (s *kafkaScaler) getTopicPartitions() (map[string][]int32, error) { if err != nil { return nil, fmt.Errorf("error describing topics: %w", err) } + s.logger.V(1).Info( + fmt.Sprintf("with topic name %s the list of topic metadata is %v", topicsToDescribe, topicsMetadata), + ) if s.metadata.topic != "" && len(topicsMetadata) != 1 { return nil, fmt.Errorf("expected only 1 topic metadata, got %d", len(topicsMetadata))