四舍五入处理器插件
此插件允许将数值字段四舍五入到配置的精度。这在与dedup 处理器结合使用时特别有用,如果只需要较低精度,可以减少发送到输出的指标数量。
引入于: Telegraf v1.36.0 标签: 转换 操作系统支持: all
全局配置选项
插件支持其他全局和插件配置设置,用于修改指标、标签和字段,创建别名以及配置插件顺序等任务。更多详情请参阅 CONFIGURATION.md。
配置
# Round numerical fields
[[processors.round]]
## Precision to round to.
## A positive number indicates rounding to the right of the decimal separator (the fractional part).
## A negative number indicates rounding to the left of the decimal separator.
# precision = 0
## Round only numeric fields matching the filter criteria below.
## Excludes takes precedence over includes.
# include_fields = ["*"]
# exclude_fields = []示例
四舍五入 inputs.cpu 插件生成的每个值,除了 usage_steal, usage_user, uptime_format, usage_idle 字段
[[inputs.cpu]]
percpu = true
totalcpu = true
collect_cpu_time = false
report_active = false
[[processors.round]]
precision = 1
include_fields = []
exclude_fields = ["usage_steal", "usage_user", "uptime_format", "usage_idle" ]cpu 指标四舍五入后的结果
- cpu map[cpu:cpu11 host:98d5b8dbad1c] map[usage_guest:0 usage_guest_nice:0 usage_idle:94.3999999994412 usage_iowait:0 usage_irq:0.1999999999998181 usage_nice:0 usage_softirq:0.20000000000209184 usage_steal:0 usage_system:1.2000000000080036 usage_user:4.000000000014552]
+ cpu map[cpu:cpu11 host:98d5b8dbad1c] map[usage_guest:0 usage_guest_nice:0 usage_idle:94.4 usage_iowait:0 usage_irq:0.2 usage_nice:0 usage_softirq:0.2 usage_steal:0 usage_system:1.2 usage_user:4.0]
此页面是否有帮助?
感谢您的反馈!
支持和反馈
感谢您成为我们社区的一员!我们欢迎并鼓励您对 Telegraf 和本文档提出反馈和 bug 报告。要获取支持,请使用以下资源
具有年度合同或支持合同的客户可以 联系 InfluxData 支持。