You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by wc...@apache.org on 2023/12/06 00:08:41 UTC

(kafka) branch trunk updated: [MINOR-PR] Enable telemetry APIs and logs suppression (KIP-714) (#14928)

This is an automated email from the ASF dual-hosted git repository.

wcarlson pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/trunk by this push:
     new a05a0d721b6 [MINOR-PR] Enable telemetry APIs and logs suppression (KIP-714) (#14928)
a05a0d721b6 is described below

commit a05a0d721b66d061789de06b9c1626d9c10fd20d
Author: Apoorv Mittal <am...@confluent.io>
AuthorDate: Wed Dec 6 05:38:35 2023 +0530

    [MINOR-PR] Enable telemetry APIs and logs suppression (KIP-714) (#14928)
    
    PR removes tag to mark API unstable in request json.
    Suppresses couple of failed telemetry API logs as those unnecessary appear when telemetry is not supported on broker.
    
    Reviewers: Walker Carlson <wc...@apache.org>, Andrew Schofield <as...@confluent.io>
---
 .../kafka/common/telemetry/internals/ClientTelemetryReporter.java | 8 +++++---
 .../common/message/GetTelemetrySubscriptionsRequest.json          | 4 ----
 .../src/main/resources/common/message/PushTelemetryRequest.json   | 4 ----
 3 files changed, 5 insertions(+), 11 deletions(-)

diff --git a/clients/src/main/java/org/apache/kafka/common/telemetry/internals/ClientTelemetryReporter.java b/clients/src/main/java/org/apache/kafka/common/telemetry/internals/ClientTelemetryReporter.java
index 08ae1d31ed4..617674f7d00 100644
--- a/clients/src/main/java/org/apache/kafka/common/telemetry/internals/ClientTelemetryReporter.java
+++ b/clients/src/main/java/org/apache/kafka/common/telemetry/internals/ClientTelemetryReporter.java
@@ -517,13 +517,13 @@ public class ClientTelemetryReporter implements MetricsReporter {
 
         @Override
         public void handleFailedGetTelemetrySubscriptionsRequest(KafkaException maybeFatalException) {
-            log.warn("The broker generated an error for the get telemetry network API request", maybeFatalException);
+            log.debug("The broker generated an error for the get telemetry network API request", maybeFatalException);
             handleFailedRequest(maybeFatalException != null);
         }
 
         @Override
         public void handleFailedPushTelemetryRequest(KafkaException maybeFatalException) {
-            log.warn("The broker generated an error for the push telemetry network API request", maybeFatalException);
+            log.debug("The broker generated an error for the push telemetry network API request", maybeFatalException);
             handleFailedRequest(maybeFatalException != null);
         }
 
@@ -825,7 +825,8 @@ public class ClientTelemetryReporter implements MetricsReporter {
                     return;
                 }
                 if (state != ClientTelemetryState.SUBSCRIPTION_IN_PROGRESS && state != ClientTelemetryState.PUSH_IN_PROGRESS) {
-                    log.warn("Could not transition state after failed telemetry from state {}", state);
+                    log.warn("Could not transition state after failed telemetry from state {}, disabling telemetry", state);
+                    updateErrorResult(Integer.MAX_VALUE, nowMs);
                     return;
                 }
 
@@ -837,6 +838,7 @@ public class ClientTelemetryReporter implements MetricsReporter {
                 if (shouldWait) {
                     updateErrorResult(DEFAULT_PUSH_INTERVAL_MS, nowMs);
                 } else {
+                    log.warn("Received unrecoverable error from broker, disabling telemetry");
                     updateErrorResult(Integer.MAX_VALUE, nowMs);
                 }
 
diff --git a/clients/src/main/resources/common/message/GetTelemetrySubscriptionsRequest.json b/clients/src/main/resources/common/message/GetTelemetrySubscriptionsRequest.json
index 1020ae717c0..3f2c5f99e4c 100644
--- a/clients/src/main/resources/common/message/GetTelemetrySubscriptionsRequest.json
+++ b/clients/src/main/resources/common/message/GetTelemetrySubscriptionsRequest.json
@@ -20,10 +20,6 @@
   "name": "GetTelemetrySubscriptionsRequest",
   "validVersions": "0",
   "flexibleVersions": "0+",
-  // The Telemetry APIs are added as part of KIP-714 and are still under
-  // development. Hence, the APIs are not exposed by default unless explicitly
-  // enabled.
-  "latestVersionUnstable": true,
   "fields": [
     {
       "name": "ClientInstanceId", "type": "uuid", "versions": "0+",
diff --git a/clients/src/main/resources/common/message/PushTelemetryRequest.json b/clients/src/main/resources/common/message/PushTelemetryRequest.json
index b01c458f045..b91cc7d94f7 100644
--- a/clients/src/main/resources/common/message/PushTelemetryRequest.json
+++ b/clients/src/main/resources/common/message/PushTelemetryRequest.json
@@ -20,10 +20,6 @@
   "name": "PushTelemetryRequest",
   "validVersions": "0",
   "flexibleVersions": "0+",
-  // The Telemetry APIs are added as part of KIP-714 and are still under
-  // development. Hence, the APIs are not exposed by default unless explicitly
-  // enabled.
-  "latestVersionUnstable": true,
   "fields": [
     {
       "name": "ClientInstanceId", "type": "uuid", "versions": "0+",