Graphite 输出数据格式
使用 graphite
输出数据格式(序列化器)来格式化和输出 Telegraf 指标,格式为 Graphite 消息格式。
序列化器使用模板模式方法(默认)或标签支持方法。要使用标签支持方法,请设置 graphite_tag_support
选项。
配置
[[outputs.file]]
## Files to write to, "stdout" is a specially handled file.
files = ["stdout", "/tmp/metrics.out"]
## Data format to output.
## Each data format has its own unique set of configuration options, read
## more about them here:
## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_OUTPUT.md
data_format = "graphite"
## Prefix added to each graphite bucket
prefix = "telegraf"
## Graphite template pattern
template = "host.tags.measurement.field"
## Support Graphite tags, recommended to enable when using Graphite 1.1 or later.
# graphite_tag_support = false
graphite_tag_support
启用 graphite_tag_support
选项后,将不使用模板模式。而是使用 Graphite 标签支持(在 Graphite 1.1 中添加)对标签进行编码。metric_path
是可选的 prefix
选项、测量名称和字段名称的组合。
标签 name
由 Graphite 保留,任何冲突的标签都将编码为 _name
。
示例转换:
cpu,cpu=cpu-total,dc=us-east-1,host=tars usage_idle=98.09,usage_user=0.89 1455320660004257758
=>
cpu.usage_user;cpu=cpu-total;dc=us-east-1;host=tars 0.89 1455320690
cpu.usage_idle;cpu=cpu-total;dc=us-east-1;host=tars 98.09 1455320690
模板
要了解有关使用模板和模板模式的更多信息,请参阅 模板模式。
此页是否对您有帮助?
感谢您的反馈!