Ruby statsd中的td代理输出
我正在尝试使用fluentd将mongo指标发送给statsd,但我遇到了一些问题 这是我的配置文件:Ruby statsd中的td代理输出,ruby,mongodb,statsd,fluentd,Ruby,Mongodb,Statsd,Fluentd,我正在尝试使用fluentd将mongo指标发送给statsd,但我遇到了一些问题 这是我的配置文件: <source> type serverstatus #https://gist.github.com/chrischang12/943a69b02f3435281557 uri mongodb://user:pass@localhost:27017/admin stats_interval 2s </source> <match serverstat
<source>
type serverstatus #https://gist.github.com/chrischang12/943a69b02f3435281557
uri mongodb://user:pass@localhost:27017/admin
stats_interval 2s
</source>
<match serverstatus.**>
type statsd
host udp.mystatsdserver.com
port 8125
</match>
我看到了mongo日志,td代理正在收集数据,但问题是,显然,td代理没有将数据发送给statsd。通过运行sudotcpdump-nn-i任意udp和src主机来确认它
有人解决过这个问题吗
我的另一个疑问是,如何在conf中配置statsdkey参数?我找到了解决方案,而且非常简单。我必须安装并设置配置以发送特定于statsd的密钥,如下例所示
<source>
type serverstatus #https://gist.github.com/chrischang12/943a69b02f3435281557
uri mongodb://user:pass@localhost:27017/admin
stats_interval 2s
</source>
<match serverstatus.reformer>
type copy
<store>
type statsd
host udp.mystatsdserver.com
port 8125
flush_interval 4s
</store>
</match>
<match serverstatus.**>
type record_reformer
tag serverstatus.reformer
statsd_key mykey
statsd_count ${my_field}
statsd_type ${"count"}
</match>
当我使用stdout类型时,可以查看日志。