0

fluentd を使用して mongo メトリクスを statsd に送信しようとしていますが、いくつか問題が発生しています。

これは私のconfです:

<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-agent によって収集されているのを見ましたが、明らかに問題は、td-agent がメトリクスを statsd に送信していないことです。次を実行して確認します。 sudo tcpdump -nn -i any udp and src host <your_ip>

誰かがこの問題を経験しましたか?

私が持っているもう1つの疑問は、conf内で「statsdkey」パラメーターをどのように構成できるかということです。

4

1 に答える 1

0

私は解決策を見つけましたが、それは非常に簡単です。fluentd reformer プラグインをインストールし、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>
于 2014-10-09T20:05:18.167 に答える