Fluentd input plugin to collect ObjectSpace information. Additionally, plugin's process information similar to fluent-plugin-watch-process.
$ gem install fluent-plugin-watch-objectspace
Add following line to your Gemfile:
gem "fluent-plugin-watch-objectspace"
And then execute:
$ bundle
parameter | type | description | default |
---|---|---|---|
watch_class | array (optional) | Class to be watched | |
watch_interval | time (optional) | Interval to watch object space | 60 |
tag | string (optional) | Tag for this input plugin | watch_objectspace |
modules | array (optional) | Modules which must be required | |
watch_delay | time (optional) | Delayed seconds until process start up | 60 |
gc_raw_data | bool (optional) | Collect GC::Profiler.raw_data | |
top_fields | array (optional) | Specify included fields of top command | ["VIRT", "RES", "SHR", "%CPU", "%MEM", "TIME+"] |
parameter | type | description | default |
---|---|---|---|
memsize_of_all | float (optional) | Threshold rate which regards increased memsize as memory leaks | 1.3 |
res_of_top | float (optional) | Threshold rate which regards increased RES as memory leaks |
If you want to monitor specific object, specify required modules and watch_class explicitly.
<source>
@type watch_objectspace
tag watch_objectspace
modules cmetrics
watch_class CMetrics::Counter, CMetrics::Gauge, CMetrics::Untyped
watch_interval 60
watch_delay 10
<threshold>
memsize_of_all 1.3
</threshold>
</source>
In above example, you must install cmetrics gem beforehand.
If memory usage is over 1.3 times, it raise an exception.
fluent-plugin-watch-process is useful cron/batch process monitoring, In contrast to it, fluent-plugin-watch-objectspace is focused on used plugin's resource usage especially object and memory.
fluent-plugin-watch-process is useful if you already know the suspicious memory leaking objects. In contrast to it, fluent-plugin-sigdump is focused on tracking backtrace and memory profile dumps.
Because alpine adopts Busybox by default, top -p or alternative ps -q is not supported.
- Copyright(c) 2021- Kentaro Hayashi
- License
- Apache License, Version 2.0