Should we write such like plugin or not?
- 1. Should we write such that
plugin or not?
Fluentd meetup in Fukuoka #fluentd
2013/03/05
@tagomoris (TAGOMORI Satoshi)
13年3月7日木曜日
- 2. TAGOMORI SATOSHI (@TAGOMORIS)
NHN JAPAN CORP.
ONE OF FLUENTD COMMITTERS
ONE OF FLUENTD PLUGIN AUTHORS
AND OTHER TOOLS (FLUENT-AGENT-LITE, ETC)
13年3月7日木曜日
- 4. Fluentd plugins
buffer plugin
input plugin
output plugin (normal output plugin)
filter output plugin
meta plugin (input / output)
fluent mixin gem
13年3月7日木曜日
- 5. Input plugins
データをfluentdに取り込む
dstat, munin, ping-message, tail-ex
parseが必要
他ノードとのデータ転送
scribe, flume, zmq, secure-forward
13年3月7日木曜日
- 6. Output plugins
Fluentd内部のデータをデータストアに書き出す
mongo, td, couch, s3, pghstore, file-alternative,
webhdfs
フォーマットが必要
Fluentd内部のデータを外部ツールにポストする
growthforecast, growl, splunk, say
13年3月7日木曜日
- 7. Filter plugins
継承関係はOutput pluginだが Engine.emit() する
経路制御・フィルタリング
rewrite, rewrite-tag-filter, sampling-filter
データ加工
parser, map, flatten, amplifier-filter
集計処理
flowcounter, datacounter, datacalculator,
numeric-monitor, notifier, numeric-counter
13年3月7日木曜日
- 8. Meta plugins
input/output どちらもある
設定を変数展開したり動的展開したり
forest, config-expander, config_pit
out_copy
13年3月7日木曜日
- 9. Fluentd mixin gems
他のプラグインに共通の機能を提供する
fluent-mixin-config-placeholders
fluent-mixin-plaintextformatter
13年3月7日木曜日
- 10. How to write plugins
Google "fluentd plugin 作り方"
bundle gem plugin_name
edit it (and write tests!)
edit plugin_name.gem and README.md
rake release
version
0.0.x: alpha/developer release (使ってない)
0.y.z: beta or standard release (使ってる)
13年3月7日木曜日
- 11. WRITE,
or DON'T WRITE
とりあえず作る?
既存のものがあるならそちらを使いたい
安定性、機能の充実、などなど
機能追加や変更:既存プラグインの継承は?
mixinがあれば使いたい
共通の設定方法、実装負荷軽減、バグの共有
13年3月7日木曜日
- 12. Write what you use
自分が使うものを作ろう
それが結局いちばん品質に貢献する
既存プラグインあるけど微妙だなー、とか
使われてないようなら奪ってしまえ
pullreq送りまくってればたぶんcommit権くれる
そのうちrelease権ももらってみんな幸せ
13年3月7日木曜日
- 13. Write buffer plugins
おススメできない
あんまり必要もないはず……
眺めるのは面白いかも
lib/fluent/buffer.rb , lib/fluent/plugin/buf_file.rb
13年3月7日木曜日
- 15. Write filter output plugins
新規に作る?
既存プラグインの組合せでできない?
exec_filterでできない?
性能や流量は大丈夫?
データ加工系はCPUをけっこう使うかも
過度な量の再emitは控えましょう
13年3月7日木曜日
- 16. Write meta plugins
新規に作る? けっ���う難しい
Fluentdのコードをちゃんと読む必要がある
モノによっては非常に強力
代用できる方法ない?
設定ファイルテンプレート + include http://...
デプロイツール類(chef, etc)
13年3月7日木曜日
- 17. Write mixin gems
とにかくmixinに切り出しとけ
format, parse, convert, ...
定型処理
再実装/コピペするほど愚かなことはない
バグレポート先、デバッグ、設定書式の共有
13年3月7日木曜日
- 18. Maintenance:
best practice
書きあげたら忘れたい: テスト超重要 (面倒…)
README書こう: release前、がんばって英語で
典型的な設定例みたいなの、超重要
広報しよう: どんな場合に便利なの? (機能だけじゃなく)
アップデートしよう: 互換性の破壊は極力避ける
pullreqに対応しよう: いいこといろいろあるよ
13年3月7日木曜日