You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
output: add metrics for number of writing events in secondary (#4971)
**Which issue(s) this PR fixes**:
Fixes #
**What this PR does / why we need it**:
Add metrics for number of writing events in secondary to Output plugins
This metrics can be used to determine whether recovery is required from
secondary if failure occurs.
**Docs Changes**:
Need to update
https://docs.fluentd.org/input/monitor_agent#output-example
**Release Note**:
Same as the title.
---------
Signed-off-by: Shizuo Fujita <fujita@clear-code.com>
Co-authored-by: Daijiro Fukuda <fukuda@clear-code.com>
Copy file name to clipboardExpand all lines: lib/fluent/plugin/output.rb
+5Lines changed: 5 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -186,6 +186,7 @@ def initialize
186
186
@emit_records_metrics=nil
187
187
@emit_size_metrics=nil
188
188
@write_count_metrics=nil
189
+
@write_secondary_count_metrics=nil
189
190
@rollback_count_metrics=nil
190
191
@flush_time_count_metrics=nil
191
192
@slow_flush_count_metrics=nil
@@ -254,6 +255,7 @@ def configure(conf)
254
255
@emit_records_metrics=metrics_create(namespace: "fluentd",subsystem: "output",name: "emit_records",help_text: "Number of emit records")
255
256
@emit_size_metrics=metrics_create(namespace: "fluentd",subsystem: "output",name: "emit_size",help_text: "Total size of emit events")
256
257
@write_count_metrics=metrics_create(namespace: "fluentd",subsystem: "output",name: "write_count",help_text: "Number of writing events")
258
+
@write_secondary_count_metrics=metrics_create(namespace: "fluentd",subsystem: "output",name: "write_secondary_count",help_text: "Number of writing events in secondary")
257
259
@rollback_count_metrics=metrics_create(namespace: "fluentd",subsystem: "output",name: "rollback_count",help_text: "Number of rollbacking operations")
258
260
@flush_time_count_metrics=metrics_create(namespace: "fluentd",subsystem: "output",name: "flush_time_count",help_text: "Count of flush time")
259
261
@slow_flush_count_metrics=metrics_create(namespace: "fluentd",subsystem: "output",name: "slow_flush_count",help_text: "Count of slow flush occurred time(s)")
@@ -1188,6 +1190,7 @@ def try_flush
1188
1190
ifoutput.delayed_commit
1189
1191
log.trace"executing delayed write and commit",chunk: dump_unique_id_hex(chunk.unique_id)
0 commit comments