diff --git a/psc-flink/src/main/java/com/pinterest/flink/connector/psc/sink/PscWriter.java b/psc-flink/src/main/java/com/pinterest/flink/connector/psc/sink/PscWriter.java index 03a6e7d..eaf7394 100644 --- a/psc-flink/src/main/java/com/pinterest/flink/connector/psc/sink/PscWriter.java +++ b/psc-flink/src/main/java/com/pinterest/flink/connector/psc/sink/PscWriter.java @@ -430,6 +430,9 @@ private void registerMetricSync() { if (closed) { return; } + if (byteOutMetric == null || byteOutMetric.metricValue() == null) { + return; + } long outgoingBytesUntilNow = ((Number) byteOutMetric.metricValue()).longValue(); long outgoingBytesSinceLastUpdate = outgoingBytesUntilNow - latestOutgoingByteTotal;