@@ -61,6 +61,8 @@ public class HealthMetrics implements AutoCloseable {
6161 CountersFactory .createFixedSizeStripedCounter (8 );
6262 private final FixedSizeStripedLongCounter samplerKeepDroppedTraces =
6363 CountersFactory .createFixedSizeStripedCounter (8 );
64+ private final FixedSizeStripedLongCounter serialFailedDroppedTraces =
65+ CountersFactory .createFixedSizeStripedCounter (8 );
6466 private final FixedSizeStripedLongCounter unsetPriorityDroppedTraces =
6567 CountersFactory .createFixedSizeStripedCounter (8 );
6668
@@ -174,8 +176,7 @@ public void onSerialize(final int serializedSizeInBytes) {
174176 }
175177
176178 public void onFailedSerialize (final List <DDSpan > trace , final Throwable optionalCause ) {
177- // TODO - DQH - make a new stat for serialization failure -- or maybe count this towards
178- // api.errors???
179+ serialFailedDroppedTraces .inc ();
179180 }
180181
181182 public void onCreateSpan () {
@@ -239,6 +240,7 @@ private static class Flush implements AgentTaskScheduler.Task<HealthMetrics> {
239240 private static final String [] USER_KEEP_TAG = new String [] {"priority:user_keep" };
240241 private static final String [] SAMPLER_DROP_TAG = new String [] {"priority:sampler_drop" };
241242 private static final String [] SAMPLER_KEEP_TAG = new String [] {"priority:sampler_keep" };
243+ private static final String [] SERIAL_FAILED_TAG = new String [] {"failure:serial" };
242244 private static final String [] UNSET_TAG = new String [] {"priority:unset" };
243245
244246 @ Override
@@ -267,6 +269,11 @@ public void run(HealthMetrics target) {
267269 target .statsd , "queue.dropped.traces" , target .samplerDropDroppedTraces , SAMPLER_DROP_TAG );
268270 reportIfChanged (
269271 target .statsd , "queue.dropped.traces" , target .samplerKeepDroppedTraces , SAMPLER_KEEP_TAG );
272+ reportIfChanged (
273+ target .statsd ,
274+ "queue.dropped.traces" ,
275+ target .serialFailedDroppedTraces ,
276+ SERIAL_FAILED_TAG );
270277 reportIfChanged (
271278 target .statsd , "queue.dropped.traces" , target .unsetPriorityDroppedTraces , UNSET_TAG );
272279 reportIfChanged (target .statsd , "queue.enqueued.spans" , target .enqueuedSpans , NO_TAGS );
0 commit comments