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.6k
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
AWSへのNIST SP800-171管理策 導入に向けての整備/20240930 Mitsutoshi Matsuo
shift_evolve
0
190
XP matsuri 2024 - 銀河英雄伝説に学ぶ
kawaguti
PRO
3
540
業務ヒアリングと知識の呪い
tamai_63
0
220
Oracle Database 23ai 新機能#4 Rolling Maintenance
oracle4engineer
PRO
0
120
Tracking down sources of kernel errors with retsnoop
ennael
PRO
0
150
分析者起点の企画を成功させた連携面の工夫
lycorptech_jp
PRO
1
240
Pythonを活用したLLMによる構造的データ生成の手法と実践
brainpadpr
3
280
たった一人で始めた音楽制作が気がついたら会社公認の部活動になっていた話〜組織の垣根を超えるコラボレーションを実現するには〜 / On-KAG-bu
piyonakajima
0
190
Rubyはなぜ「たのしい」のか? / Why is Ruby a programmers' best friend? #tqrk15
expajp
4
1.8k
【shownet.conf_】革新と伝統を融合したファシリティ
shownet
PRO
0
310
Azure Verified Moduleを触って分かった注目ポイント/azure-verified-module-begin
mhrtech
1
310
Efficient zero-copy networking using io_uring
ennael
PRO
0
320
Featured
See All Featured
The Brand Is Dead. Long Live the Brand.
mthomps
53
38k
Embracing the Ebb and Flow
colly
83
4.4k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
364
22k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
327
21k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
Being A Developer After 40
akosma
84
590k
Creatively Recalculating Your Daily Design Routine
revolveconf
217
12k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.3k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
38
2.1k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
37
1.7k
Bash Introduction
62gerente
608
210k
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