If you set this parameter, this plugin emits metrics as records. See "Reuse plugins" section.
emit_interval
type
default
version
integer
60
0.14.0
The interval time between event emits. This will be used when tag is configured.
include_config
type
default
version
bool
true
0.14.0
You can set this option to false to remove the config field from the response.
include_retry
type
default
version
bool
true
0.14.11
You can set this option to false to remove the retry field from the response.
Configuration Example
Here is a configuration example using in_monitor_agent:
When using this plugin, we strongly recommend setting @id on each plugin in use. This makes the task to identify which record corresponds to which plugin much easier. Without @id, Fluentd uses object_id as the unique identifier, so you cannot identify a record just by looking at its plugin_id field.
Output Example
Here is how the output looks like in JSON:
If the plugin is an output plugin with the buffer settings, the metrics include the buffer related fields.
retry
If the output plugin is in retry status, additional fields are added to retry. For example, if the Elasticsearch plugin fails to flush the buffer.
Here is the response:
steps field in retry show the number of flush failures, so next is the third try. retry_count is the total number of flush failures. This value is cleared when fluentd restarts, not when retry succeeds.
Tips and Tricks
How to use query parameters to tune outputs
This plugin supports a number of query parameters with which you can customize the output format of HTTP responses. For example, you can append debug=1 to the request URL to get the verbose internal metrics:
The following list shows the available query parameters:
Parameter
Value
Explanation
debug
Constant
Expose additional internal metrics. Note that sensitive configuration value (password and so on) will be shown without obfuscating
with_ivars
Variable names
Expose the specified instance variables of each plugin
with_config
Boolean
Override the configuration option with_config
with_retry
Boolean
Override the configuration option with_retry
tag
Event tag
Only show plugins that matches the specified tag
@id
Plugin id
Filter plugins by plugin id
@type
Plugin type
Filter plugins by plugin type
How to emit metrics as events
You can emit the internal metrics as events by setting the tag.
For example:
Note that in_monitor_agent produces separate records for each plugin. Thus, using this configuration, you will receive events like below once per minute:
Multi-Process Environment
If you use this plugin under the multi-process environment, the HTTP server will be launched in each worker. Port is assigned sequentially. For example, with this configuration:
Three (3) HTTP servers will be launched with:
port 24230 for worker 0
port 24231 for worker 1
port 24232 for worker 2
Note that you may need to set worker_id to @id parameter. See config article.