LoginSignup
10

More than 5 years have passed since last update.

fluentdのmonitorのメトリクスをmackerelで見る

Posted at

td-agentの設定でmonitorの記述をしておく

/etc/td-agent/td-agent.conf

<source>
  @id input
  @type forward
  port 24224
</source>

# monitor の設定を追加
<source>
  @type monitor_agent
  @id   monitor_agent
  bind 0.0.0.0
  port 24220
</source>

@include conf.d/foo.conf

mackerel-agent-plugins をパッケージでインストールしてある状態で

mackerel-agent-plugins-0.15.2-1.noarch 以上

/etc/mackerel-agent/conf.d/plugin-fluent-monitor.conf

[plugin.metrics.fluentd]
command = "/usr/local/bin/mackerel-plugin-fluentd"

こんな設定を入れておく、大切なのは必ず@idの設定を入れること。
じゃないとobject:3fec669d6ac4のような値になってしまうので。
また、大量にあってどこか設定が足りないみたいな場合は

curl http://localhost:24220/api/plugins.json | jq . | less

とかでそのオブジェクトのIDを探せば設定箇所がわかるのでそれでつぶしていく。

結果

mackerelでfluentdのmonitorがホスト毎に確認できるようになる。

fluentd.png

これやってる記事が見つからなかったのでメモ程度に書いた。
さっそくバッファたまってるのが確認できたので問題を潰していく。

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
10