public static ByteBuffer decompress(byte[] metrics, CompressionType compressionType) {
        ByteBuffer data = ByteBuffer.wrap(metrics);
        Compression compression = Compression.of(compressionType).build();
        try (InputStream in = compression.wrapForInput(data, RecordBatch.CURRENT_MAGIC_VALUE, BufferSupplier.create());
            ByteBufferOutputStream out = new ByteBufferOutputStream(512)) {
            byte[] bytes = new byte[data.capacity() * 2];
            int nRead;
            while ((nRead = in.read(bytes, 0, bytes.length)) != -1) {
                out.write(bytes, 0, nRead);
            }
            out.buffer().flip();
            return out.buffer();
        } catch (IOException e) {
            throw new KafkaException("Failed to decompress metrics data", e);
        }
    }
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