Upgrade to Pro — share decks privately, control downloads, hide ads and more …

PrometheusExporterを作ってみた+α

Transnano
February 12, 2019

 PrometheusExporterを作ってみた+α

2019/02/12 Fukuoka.go#13で登壇した内容です
タグ:Prometheus, golang

Transnano

February 12, 2019
Tweet

More Decks by Transnano

Other Decks in Technology

Transcript

  1. PrometheusExporterの作り方 公式のWritingExporters - Prometheus Docsを参照 命名規則や呼び出し方などのお作法に従うこと 1. Exporterの名前には-が使えない(実行時にエラーになる a. ❎abc-exporter、⭕abc_exporter

    2. Metricsの名称にも-は使えない(プログラミング言語も変数に-が使えない のと同じ理由)、prefixを付けるとわかりやすい a. ❎abc-cpu-num、⭕abc_cpu_usage、abc_memory_usage 3. 動作portはある程度Default-port-allocationsで決まっているが変更 できるように作り込んでおくと良い a. $ ./shell-exit-status-exporter -web.listen-address=”:9121”