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.8k
Mackerel's first year and onward (in English)
stanaka
0
360
Blue-Green Deployment with ECS and monitoring
stanaka
0
570
Mackerel Meetup #4 (in Eng)
stanaka
0
480
Mackerel Meetup #4
stanaka
0
3.1k
Other Decks in Technology
See All in Technology
APIテスト自動化の勘所
yokawasa
7
4.1k
Commitment vs Harrisonism - Keynote for Scrum Niseko 2024
miholovesq
6
1.1k
ガチ勢によるPipeCD運用大全〜滑らかなCI/CDを添えて〜 / ai-pipecd-encyclopedia
cyberagentdevelopers
PRO
3
200
顧客が本当に必要だったもの - パフォーマンス改善編 / Make what is needed
soudai
24
6.8k
Nix入門パラダイム編
asa1984
2
200
Amazon FSx for NetApp ONTAPを利用するにあたっての要件整理と設計のポイント
non97
1
160
AWSコンテナ本出版から3年経った今、もし改めて執筆し直すなら / If I revise our container book
iselegant
15
4k
Product Engineer Night #6プロダクトエンジニアを育む仕組み・施策
hacomono
PRO
1
470
30万人が利用するチャットをFirebase Realtime DatabaseからActionCableへ移行する方法
ryosk7
5
350
リンクアンドモチベーション ソフトウェアエンジニア向け紹介資料 / Introduction to Link and Motivation for Software Engineers
lmi
4
290k
よくわからんサービスについての問い合わせが来たときの強い味方 Amazon Q について
kazzpapa3
0
220
急成長中のWINTICKETにおける品質と開発スピードと向き合ったQA戦略と今後の展望 / winticket-autify
cyberagentdevelopers
PRO
1
160
Featured
See All Featured
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
Unsuck your backbone
ammeep
668
57k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.2k
Keith and Marios Guide to Fast Websites
keithpitt
408
22k
GraphQLの誤解/rethinking-graphql
sonatard
66
9.9k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.1k
Adopting Sorbet at Scale
ufuk
73
9k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
9
680
XXLCSS - How to scale CSS and keep your sanity
sugarenia
246
1.3M
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
27
1.9k
Writing Fast Ruby
sferik
626
61k
Learning to Love Humans: Emotional Interface Design
aarron
272
40k
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