20
Should we write such that plugin or not? Fluentd meetup in Fukuoka #fluentd 2013/03/05 @tagomoris (TAGOMORI Satoshi) 1337日木曜日

Should we write such like plugin or not?

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: Should we write such like plugin or not?

Should we write such that plugin or not?

Fluentd meetup in Fukuoka #fluentd2013/03/05@tagomoris (TAGOMORI Satoshi)

13年3月7日木曜日

Page 2: Should we write such like plugin or not?

TAGOMORI SATOSHI (@TAGOMORIS)NHN JAPAN CORP.

ONE OF FLUENTD COMMITTERSONE OF FLUENTD PLUGIN AUTHORS

AND OTHER TOOLS (FLUENT-AGENT-LITE, ETC)13年3月7日木曜日

Page 3: Should we write such like plugin or not?

13年3月7日木曜日

Page 4: Should we write such like plugin or not?

Fluentd pluginsbuffer plugin

input plugin

output plugin (normal output plugin)

filter output plugin

meta plugin (input / output)

fluent mixin gem

13年3月7日木曜日

Page 5: Should we write such like plugin or not?

Input pluginsデータをfluentdに取り込む

dstat, munin, ping-message, tail-ex

parseが必要

他ノードとのデータ転送

scribe, flume, zmq, secure-forward

13年3月7日木曜日

Page 6: Should we write such like plugin or not?

Output pluginsFluentd内部のデータをデータストアに書き出す

mongo, td, couch, s3, pghstore, file-alternative, webhdfs

フォーマットが必要

Fluentd内部のデータを外部ツールにポストする

growthforecast, growl, splunk, say

13年3月7日木曜日

Page 7: Should we write such like plugin or not?

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日木曜日

Page 8: Should we write such like plugin or not?

Meta plugins

input/output どちらもある

設定を変数展開したり動的展開したり

forest, config-expander, config_pit

out_copy

13年3月7日木曜日

Page 9: Should we write such like plugin or not?

Fluentd mixin gems

他のプラグインに共通の機能を提供する

fluent-mixin-config-placeholders

fluent-mixin-plaintextformatter

13年3月7日木曜日

Page 10: Should we write such like plugin or not?

How to write pluginsGoogle "fluentd plugin 作り方"

bundle gem plugin_nameedit it (and write tests!)edit plugin_name.gem and README.mdrake release

version0.0.x: alpha/developer release (使ってない)

0.y.z: beta or standard release (使ってる)

13年3月7日木曜日

Page 11: Should we write such like plugin or not?

WRITE,or DON'T WRITEとりあえず作る?

既存のものがあるならそちらを使いたい

安定性、機能の充実、などなど

機能追加や変更:既存プラグインの継承は?

mixinがあれば使いたい

共通の設定方法、実装負荷軽減、バグの共有

13年3月7日木曜日

Page 12: Should we write such like plugin or not?

Write what you use自分が使うものを作ろう

それが結局いちばん品質に貢献する

既存プラグインあるけど微妙だなー、とか

使われてないようなら奪ってしまえ

pullreq送りまくってればたぶんcommit権くれる

そのうちrelease権ももらってみんな幸せ

13年3月7日木曜日

Page 13: Should we write such like plugin or not?

Write buffer plugins

おススメできない

あんまり必要もないはず……

眺めるのは面白いかも

lib/fluent/buffer.rb , lib/fluent/plugin/buf_file.rb

13年3月7日木曜日

Page 14: Should we write such like plugin or not?

Write input pluginsWrite output plugins

Don't think, write.

13年3月7日木曜日

Page 15: Should we write such like plugin or not?

Write filter output plugins新規に作る?

既存プラグインの組合せでできない?

exec_filterでできない?

性能や流量は大丈夫?

データ加工系はCPUをけっこう使うかも

過度な量の再emitは控えましょう

13年3月7日木曜日

Page 16: Should we write such like plugin or not?

Write meta plugins新規に作る? けっこう難しい

Fluentdのコードをちゃんと読む必要がある

モノによっては非常に強力

代用できる方法ない?

設定ファイルテンプレート + include http://...

デプロイツール類(chef, etc)

13年3月7日木曜日

Page 17: Should we write such like plugin or not?

Write mixin gems

とにかくmixinに切り出しとけ

format, parse, convert, ...

定型処理

再実装/コピペするほど愚かなことはない

バグレポート先、デバッグ、設定書式の共有

13年3月7日木曜日

Page 18: Should we write such like plugin or not?

Maintenance: best practice

書きあげたら忘れたい: テスト超重要 (面倒…)

README書こう: release前、がんばって英語で

典型的な設定例みたいなの、超重要

広報しよう: どんな場合に便利なの? (機能だけじゃなく)

アップデートしよう: 互換性の破壊は極力避ける

pullreqに対応しよう: いいこといろいろあるよ

13年3月7日木曜日

Page 19: Should we write such like plugin or not?

fluentd.org/plugin/

ダウンロード数ランキング

射幸心を煽られる

目指せkanicounterライン突破

13年3月7日木曜日

Page 20: Should we write such like plugin or not?

NO PLUGINSNO FLUENTD

Thanks!

13年3月7日木曜日