@@ -1913,6 +1913,10 @@ static int append_to_ring_buffer(struct flb_input_instance *ins,
1913
1913
if (retries >= retry_limit ) {
1914
1914
flb_plg_error (ins , "could not enqueue records into the ring buffer" );
1915
1915
destroy_chunk_raw (cr );
1916
+
1917
+ /* update failed retries counter */
1918
+ cmt_counter_add (ins -> cmt_ring_buffer_retry_failures , cfl_time_now (),
1919
+ 1 , 1 , (char * []) {(char * ) flb_input_name (ins )});
1916
1920
return -1 ;
1917
1921
}
1918
1922
@@ -1922,12 +1926,22 @@ static int append_to_ring_buffer(struct flb_input_instance *ins,
1922
1926
flb_plg_debug (ins , "failed buffer write, retries=%i\n" ,
1923
1927
retries );
1924
1928
1929
+ /* if the ring buffer is full, we need to retry, update the counters */
1930
+ cmt_counter_add (ins -> cmt_ring_buffer_retries , cfl_time_now (),
1931
+ 1 , 1 , (char * []) {(char * ) flb_input_name (ins )});
1932
+
1933
+
1925
1934
/* sleep for 100000 microseconds (100 milliseconds) */
1926
1935
usleep (100000 );
1927
1936
retries ++ ;
1937
+
1928
1938
goto retry ;
1929
1939
}
1930
1940
1941
+ /* update successful writes */
1942
+ cmt_counter_add (ins -> cmt_ring_buffer_writes , cfl_time_now (),
1943
+ 1 , 1 , (char * []) {(char * ) flb_input_name (ins )});
1944
+
1931
1945
return 0 ;
1932
1946
}
1933
1947
0 commit comments