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
開発生産性を上げながらビジネスも30倍成長させてきたチームの姿
kamina_zzz
2
1.7k
強いチームと開発生産性
onk
PRO
35
11k
個人でもIAM Identity Centerを使おう!(アクセス管理編)
ryder472
4
230
AWS Lambda のトラブルシュートをしていて思うこと
kazzpapa3
2
180
FlutterアプリにおけるSLI/SLOを用いたユーザー体験の可視化と計測基盤構築
ostk0069
0
110
組織成長を加速させるオンボーディングの取り組み
sudoakiy
2
220
Storybook との上手な向き合い方を考える
re_taro
1
220
100 名超が参加した日経グループ横断の競技型 AWS 学習イベント「Nikkei Group AWS GameDay」の紹介/mediajaws202411
nikkei_engineer_recruiting
1
170
AIチャットボット開発への生成AI活用
ryomrt
0
170
アプリエンジニアのためのGraphQL入門.pdf
spycwolf
0
100
【Pycon mini 東海 2024】Google Colaboratoryで試すVLM
kazuhitotakahashi
2
550
SRE×AIOpsを始めよう!GuardDutyによるお手軽脅威検出
amixedcolor
0
190
Featured
See All Featured
Statistics for Hackers
jakevdp
796
220k
Making the Leap to Tech Lead
cromwellryan
133
8.9k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
Art, The Web, and Tiny UX
lynnandtonic
297
20k
Teambox: Starting and Learning
jrom
133
8.8k
Documentation Writing (for coders)
carmenintech
65
4.4k
GraphQLの誤解/rethinking-graphql
sonatard
67
10k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
38
1.8k
Designing on Purpose - Digital PM Summit 2013
jponch
115
7k
Fireside Chat
paigeccino
34
3k
A better future with KSS
kneath
238
17k
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