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
480
Mackerel Meetup #4
stanaka
0
3.1k
Other Decks in Technology
See All in Technology
隣接領域をBeyondするFinatextのエンジニア組織設計 / beyond-engineering-areas
stajima
1
270
Terraform Stacks入門 #HashiTalks
msato
0
350
[FOSS4G 2024 Japan LT] LLMを使ってGISデータ解析を自動化したい!
nssv
1
210
TypeScript、上達の瞬間
sadnessojisan
46
13k
マルチプロダクトな開発組織で 「開発生産性」に向き合うために試みたこと / Improving Multi-Product Dev Productivity
sugamasao
1
300
IBC 2024 動画技術関連レポート / IBC 2024 Report
cyberagentdevelopers
PRO
0
110
ノーコードデータ分析ツールで体験する時系列データ分析超入門
negi111111
0
410
初心者向けAWS Securityの勉強会mini Security-JAWSを9ヶ月ぐらい実施してきての近況
cmusudakeisuke
0
120
Shopifyアプリ開発における Shopifyの機能活用
sonatard
4
250
AWS Lambdaと歩んだ“サーバーレス”と今後 #lambda_10years
yoshidashingo
1
170
Python(PYNQ)がテーマのAMD主催のFPGAコンテストに参加してきた
iotengineer22
0
470
Why does continuous profiling matter to developers? #appdevelopercon
salaboy
0
180
Featured
See All Featured
It's Worth the Effort
3n
183
27k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
Ruby is Unlike a Banana
tanoku
97
11k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
93
16k
VelocityConf: Rendering Performance Case Studies
addyosmani
325
24k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
329
21k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.3k
Agile that works and the tools we love
rasmusluckow
327
21k
How GitHub (no longer) Works
holman
310
140k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
42
9.2k
Testing 201, or: Great Expectations
jmmastey
38
7.1k
How to Think Like a Performance Engineer
csswizardry
20
1.1k
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