From 669d5c459d08857b406e48b5c7097fe6747787fb Mon Sep 17 00:00:00 2001 From: dttung2905 Date: Mon, 30 Oct 2023 22:36:09 +0000 Subject: [PATCH 1/4] Add more logs to debug the output of Sarama DescribeTopics Signed-off-by: dttung2905 --- pkg/scalers/kafka_scaler.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/scalers/kafka_scaler.go b/pkg/scalers/kafka_scaler.go index 7d198c11eda..abad65e7203 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.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)) From 470ce9d194e4829d6c2185a6a72af620cdfc508b Mon Sep 17 00:00:00 2001 From: dttung2905 Date: Mon, 30 Oct 2023 22:49:53 +0000 Subject: [PATCH 2/4] Add CHANGELOG.md Signed-off-by: dttung2905 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d230956e6a4..63a7f22c594 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -65,6 +65,7 @@ Here is an overview of all new **experimental** features: - **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 support for Kerberos authentication (SASL / GSSAPI) ([#4836](https://github.com/kedacore/keda/issues/4836)) +- **Kafka Scaler**: Add more logging to check Sarama DescribeTopics method ([#5102](https://github.com/kedacore/keda/issues/5102)) - **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)) From 20747ac70397cef012e6417f1e355f9869a74b1e Mon Sep 17 00:00:00 2001 From: dttung2905 Date: Tue, 31 Oct 2023 22:05:51 +0000 Subject: [PATCH 3/4] Fix CHANGELOG and put appropriate log level Signed-off-by: dttung2905 --- CHANGELOG.md | 2 +- pkg/scalers/kafka_scaler.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 63a7f22c594..b2950472e5e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -64,8 +64,8 @@ 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 support for Kerberos authentication (SASL / GSSAPI) ([#4836](https://github.com/kedacore/keda/issues/4836)) - **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/kafka_scaler.go b/pkg/scalers/kafka_scaler.go index abad65e7203..6c58e5efb9b 100644 --- a/pkg/scalers/kafka_scaler.go +++ b/pkg/scalers/kafka_scaler.go @@ -594,7 +594,7 @@ func (s *kafkaScaler) getTopicPartitions() (map[string][]int32, error) { if err != nil { return nil, fmt.Errorf("error describing topics: %w", err) } - s.logger.Info( + s.logger.V(1).Info( fmt.Sprintf("with topic name %s the list of topic metadata is %v", topicsToDescribe, topicsMetadata), ) From b729014736dced7b40eb385e3215c9e05dcebee0 Mon Sep 17 00:00:00 2001 From: dttung2905 Date: Thu, 2 Nov 2023 21:47:39 +0000 Subject: [PATCH 4/4] Make logging consistent in both kafka scalers Signed-off-by: dttung2905 --- pkg/scalers/apache_kafka_scaler.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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