public static boolean validateResourceLabel(Map<String, ?> m, String key) {
        if (!m.containsKey(key)) {
            log.trace("{} does not exist in map {}", key, m);
            return false;
        }

        if (m.get(key) == null) {
            log.trace("{} is null. map {}", key, m);
            return false;
        }

        if (!(m.get(key) instanceof String)) {
            log.trace("{} is not a string. map {}", key, m);
            return false;
        }

        String val = (String) m.get(key);
        if (val.isEmpty()) {
            log.trace("{} is empty string. value = {} map {}", key, val, m);
            return false;
        }
        return true;
    }
Examine the response data and handle different error code accordingly:

<ul>
    <li>Invalid Request: Disable Telemetry</li>
    <li>Invalid Record: Disable Telemetry</li>
    <li>Unsupported Version: Disable Telemetry</li>
    <li>UnknownSubscription or Unsupported Compression: Retry immediately</li>
    <li>TelemetryTooLarge or ThrottlingQuotaExceeded: Retry as per next interval</li>
</ul>

@param errorCode response body error code
@param intervalMs current push interval in milliseconds

@return Optional of push interval in milliseconds
clients/src/main/java/org/apache/kafka/common/telemetry/internals/ClientTelemetryUtils.java