2017-07-14 06:58:20 +08:00
|
|
|
# Fluentd Input Plugin
|
|
|
|
|
|
2022-06-08 05:37:08 +08:00
|
|
|
The fluentd plugin gathers metrics from plugin endpoint provided by [in_monitor
|
|
|
|
|
plugin][1]. This plugin understands data provided by /api/plugin.json resource
|
|
|
|
|
(/api/config.json is not covered).
|
2017-07-14 06:58:20 +08:00
|
|
|
|
2022-06-08 05:37:08 +08:00
|
|
|
You might need to adjust your fluentd configuration, in order to reduce series
|
|
|
|
|
cardinality in case your fluentd restarts frequently. Every time fluentd starts,
|
|
|
|
|
`plugin_id` value is given a new random value. According to [fluentd
|
|
|
|
|
documentation][2], you are able to add `@id` parameter for each plugin to avoid
|
|
|
|
|
this behaviour and define custom `plugin_id`.
|
2017-07-14 06:58:20 +08:00
|
|
|
|
2018-12-11 07:24:11 +08:00
|
|
|
example configuration with `@id` parameter for http plugin:
|
2021-11-25 02:56:26 +08:00
|
|
|
|
|
|
|
|
```text
|
2017-07-14 06:58:20 +08:00
|
|
|
<source>
|
|
|
|
|
@type http
|
|
|
|
|
@id http
|
|
|
|
|
port 8888
|
|
|
|
|
</source>
|
|
|
|
|
```
|
|
|
|
|
|
2022-06-08 05:37:08 +08:00
|
|
|
[1]: https://docs.fluentd.org/input/monitor_agent
|
|
|
|
|
[2]: https://docs.fluentd.org/configuration/config-file#common-plugin-parameter
|
|
|
|
|
|
2021-11-25 02:56:26 +08:00
|
|
|
## Configuration
|
2017-07-14 06:58:20 +08:00
|
|
|
|
2022-05-24 21:49:47 +08:00
|
|
|
```toml @sample.conf
|
2017-07-14 06:58:20 +08:00
|
|
|
# Read metrics exposed by fluentd in_monitor plugin
|
|
|
|
|
[[inputs.fluentd]]
|
|
|
|
|
## This plugin reads information exposed by fluentd (using /api/plugins.json endpoint).
|
|
|
|
|
##
|
2017-09-06 03:55:21 +08:00
|
|
|
## Endpoint:
|
2017-07-14 06:58:20 +08:00
|
|
|
## - only one URI is allowed
|
|
|
|
|
## - https is not supported
|
|
|
|
|
endpoint = "http://localhost:24220/api/plugins.json"
|
2017-09-06 03:55:21 +08:00
|
|
|
|
2017-07-14 06:58:20 +08:00
|
|
|
## Define which plugins have to be excluded (based on "type" field - e.g. monitor_agent)
|
|
|
|
|
exclude = [
|
2021-11-25 02:56:26 +08:00
|
|
|
"monitor_agent",
|
|
|
|
|
"dummy",
|
2017-07-14 06:58:20 +08:00
|
|
|
]
|
|
|
|
|
```
|
|
|
|
|
|
2021-11-25 02:56:26 +08:00
|
|
|
## Measurements & Fields
|
2017-07-14 06:58:20 +08:00
|
|
|
|
2018-12-11 07:24:11 +08:00
|
|
|
Fields may vary depending on the plugin type
|
2017-07-14 06:58:20 +08:00
|
|
|
|
|
|
|
|
- fluentd
|
2022-05-18 04:12:35 +08:00
|
|
|
- retry_count (float, unit)
|
|
|
|
|
- buffer_queue_length (float, unit)
|
2021-11-25 02:56:26 +08:00
|
|
|
- buffer_total_queued_size (float, unit)
|
2022-05-18 04:12:35 +08:00
|
|
|
- rollback_count (float, unit)
|
|
|
|
|
- flush_time_count (float, unit)
|
|
|
|
|
- slow_flush_count (float, unit)
|
|
|
|
|
- emit_count (float, unit)
|
|
|
|
|
- emit_records (float, unit)
|
|
|
|
|
- emit_size (float, unit)
|
|
|
|
|
- write_count (float, unit)
|
|
|
|
|
- buffer_stage_length (float, unit)
|
|
|
|
|
- buffer_queue_byte_size (float, unit)
|
|
|
|
|
- buffer_stage_byte_size (float, unit)
|
|
|
|
|
- buffer_available_buffer_space_ratios (float, unit)
|
2017-07-14 06:58:20 +08:00
|
|
|
|
2021-11-25 02:56:26 +08:00
|
|
|
## Tags
|
2017-07-14 06:58:20 +08:00
|
|
|
|
|
|
|
|
- All measurements have the following tags:
|
2021-11-25 02:56:26 +08:00
|
|
|
- plugin_id (unique plugin id)
|
|
|
|
|
- plugin_type (type of the plugin e.g. s3)
|
2017-07-14 06:58:20 +08:00
|
|
|
- plugin_category (plugin category e.g. output)
|
|
|
|
|
|
2021-11-25 02:56:26 +08:00
|
|
|
## Example Output
|
2017-07-14 06:58:20 +08:00
|
|
|
|
2021-11-25 02:56:26 +08:00
|
|
|
```shell
|
2017-07-14 06:58:20 +08:00
|
|
|
$ telegraf --config fluentd.conf --input-filter fluentd --test
|
|
|
|
|
* Plugin: inputs.fluentd, Collection 1
|
|
|
|
|
> fluentd,host=T440s,plugin_id=object:9f748c,plugin_category=input,plugin_type=dummy buffer_total_queued_size=0,buffer_queue_length=0,retry_count=0 1492006105000000000
|
|
|
|
|
> fluentd,plugin_category=input,plugin_type=dummy,host=T440s,plugin_id=object:8da98c buffer_queue_length=0,retry_count=0,buffer_total_queued_size=0 1492006105000000000
|
|
|
|
|
> fluentd,plugin_id=object:820190,plugin_category=input,plugin_type=monitor_agent,host=T440s retry_count=0,buffer_total_queued_size=0,buffer_queue_length=0 1492006105000000000
|
|
|
|
|
> fluentd,plugin_id=object:c5e054,plugin_category=output,plugin_type=stdout,host=T440s buffer_queue_length=0,retry_count=0,buffer_total_queued_size=0 1492006105000000000
|
|
|
|
|
> fluentd,plugin_type=s3,host=T440s,plugin_id=object:bd7a90,plugin_category=output buffer_queue_length=0,retry_count=0,buffer_total_queued_size=0 1492006105000000000
|
2022-05-18 04:12:35 +08:00
|
|
|
> fluentd,plugin_id=output_td, plugin_category=output,plugin_type=tdlog, host=T440s buffer_available_buffer_space_ratios=100,buffer_queue_byte_size=0,buffer_queue_length=0,buffer_stage_byte_size=0,buffer_stage_length=0,buffer_total_queued_size=0,emit_count=0,emit_records=0,flush_time_count=0,retry_count=0,rollback_count=0,slow_flush_count=0,write_count=0 1651474085000000000
|
2017-07-14 06:58:20 +08:00
|
|
|
```
|