From de27ef2455b0d70db26ef45ac908a230346d150a Mon Sep 17 00:00:00 2001 From: Paul Moineau Date: Wed, 6 Sep 2023 12:04:20 -0400 Subject: [PATCH] W-14071255: set isAbsent(true) for null values --- .../service/engine/GraphiteSeriesDataServlet.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/carbonj.service/src/main/java/com/demandware/carbonj/service/engine/GraphiteSeriesDataServlet.java b/carbonj.service/src/main/java/com/demandware/carbonj/service/engine/GraphiteSeriesDataServlet.java index c086ff0f..751bf364 100644 --- a/carbonj.service/src/main/java/com/demandware/carbonj/service/engine/GraphiteSeriesDataServlet.java +++ b/carbonj.service/src/main/java/com/demandware/carbonj/service/engine/GraphiteSeriesDataServlet.java @@ -171,8 +171,15 @@ else if ( protobuf ) { LOG.info( String.format( "carbonapi request: found value [%s]", ( value == null ? "null" : (double) value ) ) ); - metricsSeriesBuilder.addValues(value); - metricsSeriesBuilder.addIsAbsent(false); + if ( value == null ) + { + metricsSeriesBuilder.addIsAbsent(true); + } + else + { + metricsSeriesBuilder.addValues(value); + metricsSeriesBuilder.addIsAbsent(false); + } } MetricsResponse.Series metricsSeries = metricsSeriesBuilder.build();