Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Mackerel - Current status #mackerelio
Search
Shinji Tanaka
September 24, 2014
Technology
3
6.7k
Mackerel - Current status #mackerelio
Mackerel Meetup #2
Sep 24, 2014
Shinji Tanaka
September 24, 2014
Tweet
Share
More Decks by Shinji Tanaka
See All by Shinji Tanaka
Mackerel loves Machine Learnings
stanaka
0
2.9k
How to Contribute Go
stanaka
4
18k
Introduction to Mackerel
stanaka
0
1k
Upcoming features in 2016, Mackerel
stanaka
0
3.3k
Mackerel's first year and onward
stanaka
0
2.9k
Mackerel's first year and onward (in English)
stanaka
0
370
Blue-Green Deployment with ECS and monitoring
stanaka
0
580
Mackerel Meetup #4 (in Eng)
stanaka
0
490
Mackerel Meetup #4
stanaka
0
3.1k
Other Decks in Technology
See All in Technology
ハイテク休憩
sat
PRO
2
130
LINE Developersプロダクト(LIFF/LINE Login)におけるフロントエンド開発
lycorptech_jp
PRO
0
120
ずっと昔に Star をつけたはずの思い出せない GitHub リポジトリを見つけたい!
rokuosan
0
150
オプトインカメラ:UWB測位を応用したオプトイン型のカメラ計測
matthewlujp
0
170
CustomCopを使ってMongoidのコーディングルールを整えてみた
jinoketani
0
220
バクラクのドキュメント解析技術と実データにおける課題 / layerx-ccc-winter-2024
shimacos
2
1k
KubeCon NA 2024 Recap / Running WebAssembly (Wasm) Workloads Side-by-Side with Container Workloads
z63d
1
240
WACATE2024冬セッション資料(ユーザビリティ)
scarletplover
0
190
NilAway による静的解析で「10 億ドル」を節約する #kyotogo / Kyoto Go 56th
ytaka23
3
370
プロダクト開発を加速させるためのQA文化の築き方 / How to build QA culture to accelerate product development
mii3king
1
260
マルチプロダクト開発の現場でAWS Security Hubを1年以上運用して得た教訓
muziyoshiz
2
2.1k
1等無人航空機操縦士一発試験 合格までの道のり ドローンミートアップ@大阪 2024/12/18
excdinc
0
150
Featured
See All Featured
How to Think Like a Performance Engineer
csswizardry
22
1.2k
How STYLIGHT went responsive
nonsquared
95
5.2k
[RailsConf 2023] Rails as a piece of cake
palkan
53
5k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Typedesign – Prime Four
hannesfritz
40
2.4k
Code Review Best Practice
trishagee
65
17k
Practical Orchestrator
shlominoach
186
10k
Designing on Purpose - Digital PM Summit 2013
jponch
116
7k
Mobile First: as difficult as doing things right
swwweet
222
9k
Rails Girls Zürich Keynote
gr2m
94
13k
Documentation Writing (for coders)
carmenintech
66
4.5k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
330
21k
Transcript
Mackerel ! - Current Status - 2014-09-24 Hatena Co., Ltd.
@stanaka
Mackerel https://mackerel.io/
ΞδΣϯμ • Mackerel Overview & Update • Mackerel ਖ਼ࣜԽͱࠓޙͷ༧ఆ
1 Mackerel Overview & Update
MackerelʢຊޠͰḉʣ • αʔόཧπʔϧ as a Service • લ: ͯͳͷࣾπʔϧ
Mackerelͷಛ • ؆୯ηοτΞοϓ • 1ͰඦͰศརʹ • ༷ʑͳ࣌ܥྻσʔλΛՄࢹԽɾࢹ • ֤छπʔϧͱͷڧྗͳ࿈ܞ
ΞʔΩςΫνϟ
Mackerelͷಛ • ؆୯ηοτΞοϓ • 1ͰඦͰศརʹ • ༷ʑͳ࣌ܥྻσʔλΛՄࢹԽɾࢹ • ֤छπʔϧͱͷڧྗͳ࿈ܞ
• Go Ͱॻ͔ΕͨެࣜΤʔδΣϯτ • Linux αϙʔτ (CentOS 5/6, Debian 6/7)
• ϗετεϖοΫͱϝτϦοΫΛऩू mackerelio/mackerel-agent mackerel-agent
agent: Πϯετʔϧ mackerel.io/my/instruction-agent • yum/apt ϦϙδτϦ͔Β • tarball • go
get
Mackerelͷಛ • ؆୯ηοτΞοϓ • 1ͰඦͰศརʹ • ༷ʑͳ࣌ܥྻσʔλΛՄࢹԽɾࢹ • ֤छπʔϧͱͷڧྗͳ࿈ܞ
αʔϏεͱϩʔϧ • αʔϏε • ͞·͟·ͳϗετ͕ڠௐ • Hatena-Bookmark, Hatena-Blog, … •
ϗετ܈ΛׂͰ·ͱΊΔ = ϩʔϧ • app, db, … IFMQKBNBDLFSFMJPFOUSZIPXUPDSFBUFTFSWJDFTBOESPMFT
αʔϏε - ϩʔϧ • Hatena-Blog • app • host01, host02,
… • db • memcached • Hatena-Bookmark • app • crawler
agent: ϩʔϧઃఆ • ઃఆ͔ΒαʔϏεɾϩʔϧΛࢦఆ • ଘࡏ͠ͳ͔ͬͨΒ࡞͢Δ • cookbook-mackerel-agent Ͱར༻ #
mackerel-‐agent.conf roles = [ “Mackerel:db”, … ]
ChefͰηοτΞοϓ͢Δ • cookbook-mackerel-agent • mackerelio/cookbook-mackerel-agent # APIΩʔΛઃఆ node.default['mackerel-‐agent']['apikey'] =
<API KEY> # αʔϏεɾϩʔϧΛࢦఆ node.default['mackerel-‐agent']['conf']['roles'] = ["My-‐Service:app", “Another-‐Service:db"] # ϓϥάΠϯΛࢦఆ node.default['mackerel-‐agent']['conf']['plugin.metrics.vmstat'] = { 'command' => 'ruby /etc/sensu/plugins/system/vmstat-‐metrics.rb', } ! include_recipe 'mackerel-‐agent'
ϗετͷϥΠϑαΠΫϧ • εςʔλεͰঢ়ଶΛཧ standby working maintenance retired ηοτΞοϓ poweroff ࢹର
௨ର
ϥΠϑαΠΫϧͱϫʔΫϑϩʔ • ϗετΛ৽ن࡞ • ຊ൪ೖɾLBࠐΈ • োରԠɺੳ • ୀ४උ •
ୀ standby working maintenance retired poweroff
Mackerelͷಛ • ؆୯ηοτΞοϓ • 1ͰඦͰศརʹ • ༷ʑͳ࣌ܥྻσʔλΛՄࢹԽɾࢹ • ֤छπʔϧͱͷڧྗͳ࿈ܞ
agent: ϝτϦοΫऩू • ϗετͷϦιʔεͷ࣌ࠁ͝ͱͷ • ඪ४: loadavg5, cpu.*, memory.*, interface.*,
disk.* • ΧελϜ: ֤छϛυϧΣΞରԠϓϥάΠϯ • αʔϏεϝτϦοΫ • Ԡ࣌ؒɾΤϥʔɾΞΫςΟϒϢʔβʔ
ϩʔϧຖͷάϥϑͰՄࢹԽ
ΩϟύγςΟϓϥϯχϯάʹ
ΦʔτεέʔϧରԠ • αʔό͕ॖୀͯ͠άϥϑΔ
agent: ΧελϜϝτϦοΫ • plugin.metrics.*.command Λهड़ # mackerel-agent.conf [plugin.metrics.my-super-metric] command =
“/path/to/my-super-metric.sh” IFMQKBNBDLFSFMJPFOUSZBEWBODFEDVTUPNNFUSJDT
agent: ΧελϜϝτϦοΫ • Sensu ϓϥάΠϯޓͷग़ྗ ʢλϒ۠Γʣ % ~/.mackerel-agent/plugins/chrome-tabs-count.sh! browser.tabs.count 9
1403153173! browser.tabs.works 7 1403153173
ΧελϜϝτϦοΫͷऔಘ • mackerel-agent-plugins • MackerelͷެࣜϓϥάΠϯू • mackerelio/mackerel-‐agent-‐plugins
• ࠷৽(0.4.0): apache2, memcached, mysql, nginx, plack, postgres, redis • ࣍ϦϦʔε: haproxy, jvm, squid, varnish
αʔϏεϝτϦοΫͷߘ • fluent-plugin-mackerel • tksmd/fluent-plugin-mackerel • ྫ: NginxͷΞΫηεϩά͔Βεςʔλείʔυ ͝ͱʹΧϯτ IFMQKBNBDLFSFMJPFOUSZBEWBODFEqVFOUE
ྫ: NginxͷΞΫηεϩά͔Β εςʔλείʔυ͝ͱʹΧϯτ #1 • tail plugin # LTSVܗࣜͷϩάϑΝΠϧΛಡΈࠐΉ
<source> type tail format ltsv time_format %d/%b/%Y:%H:%M:%S %z path /var/log/nginx/access.log pos_file /var/log/nginx/access_log.pos tag access.nginx </source>
ྫ: NginxͷΞΫηεϩά͔Β εςʔλείʔυ͝ͱʹΧϯτ #2 • fluent-plugin-datacounter # fluent-‐plugin-‐datacounterͰεςʔλείʔυผʹूܭ͢Δ <match
access.nginx> type datacounter count_interval 1m count_key status aggregate all tag nginx.status pattern1 2xx ^2\d\d$ pattern2 3xx ^3\d\d$ pattern3 4xx ^4\d\d$ pattern4 5xx ^5\d\d$ </match>
ྫ: NginxͷΞΫηεϩά͔Β εςʔλείʔυ͝ͱʹΧϯτ #3 • fluent-plugin-mackerel # fluent-‐plugin-‐mackerelʹΑΓαʔϏεϝτϦοΫΛߘ͢Δ <match
nginx.status.**> type mackerel api_key <ߘઌΦʔΨχθʔγϣϯͷAPIΩʔ> service <ߘઌαʔϏε໊> metrics_name access_num.${out_key} out_keys 2xx_count,3xx_count,4xx_count,5xx_count </match>
CloudWatch → Mackerel • fluent-plugin-cloudwatch • fluent-plugin-mackerel
ࢹ(Monitor) • ࢮ׆ࢹ • ϝτϦοΫࢹ • Ұఆ࣌ؒɺᮢΛӽ͑ΔͱΞϥʔτ • ݱঢ়શϗετ(working, standby)Λର
IFMQKBNBDLFSFMJPFOUSZIPXUPBMFSUT
ࢹ(Monitor)ͷࠓޙ ! • ϗετ • ϩʔϧ୯Ґͷ݅ઃఆ(Coming Soon!) • αʔϏε •
αʔϏεϝτϦοΫʹର͢Δࢹ(Coming Soon!)
Mackerelͷಛ • ؆୯ηοτΞοϓ • 1ͰඦͰศརʹ • ༷ʑͳ࣌ܥྻσʔλΛՄࢹԽɾࢹ • ֤छπʔϧͱͷڧྗͳ࿈ܞ
Ξϥʔτͷ௨(νϟϯωϧ) • ϝʔϧ௨ • Webhook
Webhook HuBot࿈ܞ • HuBotͰWebhookΛड͚औΓ௨ ! • mackerelio/hubot-mackerel-notifier IFMQKBNBDLFSFMJPFOUSZBEWBODFEIVCPU npm install
hubot-‐mackerel-‐notifier -‐-‐save
Slackͷͷ௨ • Coming Soon!!
mackerel-client gem rubygems.org/gems/mackerel-client hosts = client.get_hosts( :service =>
'Hatena-‐Blog', :roles => 'proxy' ) ! client.update_host_status host_id, 'working'
mkr: CLI Mackerel Client • mkr host info --service Hatena-Blog
--role proxy! • mkr host status —host-id <host_id> —status working
Capistrano ࿈ܞ • config/deployͷMackerel APIͱͷ࿈ ܞΛهड़ → ৄࡉϔϧϓ # bundle
exec cap deploy:echo * 2014-‐09-‐23 21:36:28 executing `deploy:echo' * executing "echo \"Integration Test\"" servers: ["127.0.0.1"] [127.0.0.1] executing command ** [out :: 127.0.0.1] Integration Test command finished in 435ms IFMQKBNBDLFSFMJPFOUSZBEWBODFEDBQJTUSBOPY
2 Mackerel ਖ਼ࣜԽͱࠓޙͷ༧ఆ
ਖ਼ࣜԽ • ϕʔλϦϦʔε (5/8) • ্࣭ɾ҆ఆԽ(υοΫϑʔσΟϯά) • ͑ΔϨϕϧػೳ։ൃ • ਖ਼ࣜϦϦʔε
(9/19)
Pricing • Standard • 2,000ԁ/ϗετɾ݄ • ϗετ 20+ ͰϘϦϡʔϜσΟεΧϯτ •
ແྉτϥΠΞϧ͋Γ • Free • 5·Ͱ • දࣔظؒ(24h)ɺαʔϏεϝτϦοΫɾࢹʹ੍ݶ
Pricing next • ݸਓ&খنϢʔβʔ͚ϓϥϯΛ ݕ౼த
Coming Soon!! • GitHubϩάΠϯ • MonitorରͷৄࡉԽ(ϩʔϧ୯Ґ) • αʔϏεϝτϦοΫͷࢹ • ΧελϜϝτϦοΫϓϥάΠϯͷॆ࣮
• Slack࿈ܞͳͲɺ௨ઌॆ࣮
Next Development • Πϕϯτ(ΞϥʔτɾσϓϩΠͳͲ) • άϥϑ্ʹϓϩοτ σϓϩΠ
Next Development • άϥϑվળ • ߴԽɾ֎෦షɾࣗಈϦϑϨογϡ • Ξϥʔτվળ • ௨ઌͷॆ࣮ɾ݅ͷΧελϚΠζ
• μογϡϘʔυΧελϚΠζ • ҙͷάϥϑΛషΓ͚ΒΕΔΑ͏ʹ
ϔϧϓ help-ja.mackerel.io
None
None
mackerel.io