From fbb205cb5195cf57bf4640e7eeb77fe93ea835f1 Mon Sep 17 00:00:00 2001 From: Vlad Gorodetsky Date: Tue, 18 Jun 2019 13:10:45 +0300 Subject: [PATCH] Expose flush_time_count and slow_flush_count metrics Signed-off-by: Vlad Gorodetsky --- lib/fluent/plugin/in_prometheus_output_monitor.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/fluent/plugin/in_prometheus_output_monitor.rb b/lib/fluent/plugin/in_prometheus_output_monitor.rb index 15f932f..91d7f70 100644 --- a/lib/fluent/plugin/in_prometheus_output_monitor.rb +++ b/lib/fluent/plugin/in_prometheus_output_monitor.rb @@ -24,6 +24,10 @@ class PrometheusOutputMonitorInput < Fluent::Input :emit_records, :write_count, :rollback_count, + + # from v1.5.3 + :flush_time_count, + :slow_flush_count, ] def initialize @@ -84,6 +88,12 @@ def start rollback_count: @registry.gauge( :fluentd_output_status_rollback_count, 'Current rollback counts.'), + flush_time_count: @registry.gauge( + :fluentd_output_status_flush_time_count, + 'Total flush time.'), + slow_flush_count: @registry.gauge( + :fluentd_output_status_slow_flush_count, + 'Current slow flush counts.'), retry_wait: @registry.gauge( :fluentd_output_status_retry_wait, 'Current retry wait'), @@ -112,6 +122,8 @@ def update_monitor_info emit_count: @metrics[:emit_count], emit_records: @metrics[:emit_records], rollback_count: @metrics[:rollback_count], + flush_time_count: @metrics[:flush_time_count], + slow_flush_count: @metrics[:slow_flush_count], } agent_info.each do |info|