stevenschlansker commented on code in PR #23444:
URL: https://github.com/apache/kafka/pull/23444#discussion_r4007110210


##########
server/src/main/java/org/apache/kafka/server/ClientMetricsManager.java:
##########
@@ -216,6 +216,14 @@ public PushTelemetryResponse 
processPushTelemetryRequest(PushTelemetryRequest re
                 long exportTimeStartMs = time.hiResClockMs();
                 clientTelemetryExporterPlugin.exportMetrics(requestContext, 
request, clientInstance.pushIntervalMs(), clientTelemetryMaxBytes);
                 clientMetricsStats.recordPluginExport(clientInstanceId, 
time.hiResClockMs() - exportTimeStartMs);
+            } catch (TelemetryTooLargeException exception) {
+                // The decompressed payload exceeded the configured size 
limit. This is retryable (the client may
+                // shrink its metric set or the broker may be reconfigured), 
unlike a malformed payload, so it must
+                // not be reported as INVALID_RECORD: that error tells the 
client to stop pushing telemetry entirely.
+                clientMetricsStats.recordPluginErrorCount(clientInstanceId);
+                clientInstance.lastKnownError(Errors.TELEMETRY_TOO_LARGE);
+                log.error("Error exporting client metrics to the plugin for 
client instance id: {}", clientInstanceId, exception);

Review Comment:
   Error with stacktrace might be too harsh here - the state is an explicit 
failure mode, resumable, and until we handle the deserialization size in a 
followup, likely quite common. Since the stacktrace is simply an error state 
mapped as an exception from a known throw site, consider WARN level and 
attaching just `exception.toString()`, dropping the stack.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to