@@ -141,8 +141,10 @@ private static final class Worker implements Runnable {
141
141
private static final Logger logger = Logger .getLogger (Worker .class .getName ());
142
142
143
143
private final LongCounter processedLogsCounter ;
144
+ private final LongCounter logsExportFailureCounter ;
144
145
private final Attributes droppedAttrs ;
145
146
private final Attributes exportedAttrs ;
147
+ private final Attributes exportFailureAttrs ;
146
148
147
149
private final LogRecordExporter logRecordExporter ;
148
150
private final long scheduleDelayNanos ;
@@ -197,6 +199,13 @@ private Worker(
197
199
"The number of logs processed by the BatchLogRecordProcessor. "
198
200
+ "[dropped=true if they were dropped due to high throughput]" )
199
201
.build ();
202
+ logsExportFailureCounter =
203
+ meter
204
+ .counterBuilder ("logsExportFailure" )
205
+ .setUnit ("1" )
206
+ .setDescription (
207
+ "Logs export failure in BatchLogRecordProcessor." )
208
+ .build ();
200
209
droppedAttrs =
201
210
Attributes .of (
202
211
LOG_RECORD_PROCESSOR_TYPE_LABEL ,
@@ -209,6 +218,10 @@ private Worker(
209
218
LOG_RECORD_PROCESSOR_TYPE_VALUE ,
210
219
LOG_RECORD_PROCESSOR_DROPPED_LABEL ,
211
220
false );
221
+ exportFailureAttrs =
222
+ Attributes .of (
223
+ LOG_RECORD_PROCESSOR_TYPE_LABEL ,
224
+ LOG_RECORD_PROCESSOR_TYPE_VALUE );
212
225
213
226
this .batch = new ArrayList <>(this .maxExportBatchSize );
214
227
}
@@ -324,6 +337,7 @@ private void exportCurrentBatch() {
324
337
processedLogsCounter .add (batch .size (), exportedAttrs );
325
338
} else {
326
339
logger .log (Level .FINE , "Exporter failed" );
340
+ logsExportFailureCounter .add (1 , exportFailureAttrs );
327
341
}
328
342
} catch (RuntimeException e ) {
329
343
logger .log (Level .WARNING , "Exporter threw an Exception" , e );
0 commit comments