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
Building Dashboards as a Hobby
Search
Sohei Iwahori
April 24, 2024
Technology
0
730
Building Dashboards as a Hobby
趣味のダッシュボード開発とDashboards as codeまわりのお話
Sohei Iwahori
April 24, 2024
Tweet
Share
More Decks by Sohei Iwahori
See All by Sohei Iwahori
PHPアプリケーションにおけるeBPFの使い所
egmc
1
1k
Runbookに何を書き、どのようにアラートを振り分けるか?
egmc
2
3.3k
プロダクション環境の信頼性を損ねず観測する技術
egmc
8
9.5k
practices-for-making-alerts-actionable.pdf
egmc
3
7.9k
Other Decks in Technology
See All in Technology
Introduction to Works of ML Engineer in LY Corporation
lycorp_recruit_jp
0
130
OCI Network Firewall 概要
oracle4engineer
PRO
0
4.2k
OCI Vault 概要
oracle4engineer
PRO
0
9.7k
マルチプロダクトな開発組織で 「開発生産性」に向き合うために試みたこと / Improving Multi-Product Dev Productivity
sugamasao
1
310
[CV勉強会@関東 ECCV2024 読み会] オンラインマッピング x トラッキング MapTracker: Tracking with Strided Memory Fusion for Consistent Vector HD Mapping (Chen+, ECCV24)
abemii
0
220
Adopting Jetpack Compose in Your Existing Project - GDG DevFest Bangkok 2024
akexorcist
0
110
AGIについてChatGPTに聞いてみた
blueb
0
130
SRE×AIOpsを始めよう!GuardDutyによるお手軽脅威検出
amixedcolor
0
140
Exadata Database Service on Dedicated Infrastructure(ExaDB-D) UI スクリーン・キャプチャ集
oracle4engineer
PRO
2
3.2k
The Role of Developer Relations in AI Product Success.
giftojabu1
1
130
ExaDB-D dbaascli で出来ること
oracle4engineer
PRO
0
3.9k
開発生産性を上げながらビジネスも30倍成長させてきたチームの姿
kamina_zzz
2
1.7k
Featured
See All Featured
Building Better People: How to give real-time feedback that sticks.
wjessup
364
19k
What's new in Ruby 2.0
geeforr
343
31k
A Modern Web Designer's Workflow
chriscoyier
693
190k
The Invisible Side of Design
smashingmag
298
50k
Statistics for Hackers
jakevdp
796
220k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
232
17k
How to train your dragon (web standard)
notwaldorf
88
5.7k
Intergalactic Javascript Robots from Outer Space
tanoku
269
27k
GraphQLとの向き合い方2022年版
quramy
43
13k
Mobile First: as difficult as doing things right
swwweet
222
8.9k
Building Applications with DynamoDB
mza
90
6.1k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
44
2.2k
Transcript
Building Dashboards as a Hobby 2024/04/24 Sohei Iwahori (GREE, Inc.)
who? » Sohei Iwahori (@egmc) » GREE, Inc. » Πϯϑϥ
/ Monitoring Unit Leader / Senior Lead Engineer » ओʹήʔϜͷΠϯϑϥͱࢹγεςϜ » σʔλιʔεओʹPrometheus
࠷ۙͷΈ » systemd_exporterʹsystemd_resolved ͷϝτϦΫεΛՃ͢ΔPR͕Ϛʔδ ͞Εͨ(1݄) » ͕৽όʔδϣϯ͕ͳ͔ͳ͔ϦϦʔε ͞Εͳ͍ » ޙͷϑϦ
࠷ۙͷΈ
agenda » μογϡϘʔυͷຽओԽ » झຯͷμογϡϘʔυ࡞Ͱ͏πʔϧ » ࡞ͬͨμογϡϘʔυͷհ » ·ͱΊ
μογϡϘʔυͷຽओԽ
GrafanaͷμογϡϘʔυͷخ͠͞ » ࢥ͍͍ͭͨμογϡϘʔυΛUI্͔Β࡞Ͱ͖Δ » τϥΠΞϯυΤϥʔͷ͞ » RRDtoolͰٯϙʔϥϯυه๏ͰάϥϑΛॻ͔࣌͘Βѹతͳརศੑ
RRDTool -> Grafana + PromQL
झຯͷμογϡϘʔυ࡞Ͱ ͏πʔϧ
μογϡϘʔυ։ൃͷΤίγεςϜ » Grafana as code ৭ʑ͋Δɾɾ1 » Grafana Terraform provider
» Grafana Ansible collection » Grizzly » Grafana Crossplane provider » Kubernetes Grafana Operator » ͦͷ΄͔ScenesͳͲ 1 A complete guide to managing Grafana as code: tools, tips, and tricks Ishan Jain.
ͲΕʹ͢Δ͔ » ਖ਼ͦΜͳʹ͜Ε͕͍͍ʂΈ͍ͨͳͷͳ͍ؾ͕͢ΔͷͰϒϩάͷ௨Γطଘͷ ίʔυࢿ࢈ʹ߹ΘͤͯͰ » τϥΠΞϯυΤϥʔखಈͰɺظతʹ࡞ΓࠐΈ͍ͨ߹ʹίʔυԽ » ͱ͍͑JSONܗࣜͳΒ݁ہϕʔεΛखͰ࡞ΔɺͰ » ݸਓͰ͓खܰʹΔʹखಈ࡞+Ұ෦GrizzlyΛར༻
Grizzly » https://github.com/grafana/grizzly » Grafana։ൃͷcliπʔϧʢgrrίϚϯυʣ » ݱࡏDashbaordཧ͚ͩͰͳ͘σʔλιʔεɺGrafana Cloud prometheus ͷrules/alertsɺSynthetic
MonitoringͷཧʹରԠ » v0.4.1࣌ » جຊͷه๏YAMLɺJSONɺJsonnetʢ+Grafonnetʣ͔ͭ͑Δ
Grizzyͱͷग़ձ͍ » 2020ࠒ0.0.1ͷalpha࣌ͰJsonnet(+Grafonnet)Ͱͷར༻ΨΠυ͕͋Γɺ͍࢝Ίͨ » લड़ͷϦΞϧλΠϜөػೳͳͲ͍উख͕ྑ͔ͬͨͷͰ͜Εͳ͔ͳ͔͍͍ͷͰͱ ࢥ͍ͬͯͨ » جຊGrafonnetͰදݱ͠ɺgrafanaDashboards:: ԼʹμογϡϘʔυΦϒδΣΫτ Λஔͯ͠apply͢ΔͱμογϡϘʔυʹө͞ΕΔ
» grr watchͰϑΝΠϧͷมߋݕͯ͠ଈ࠲ʹremoteͷGrafanaΠϯελϯεʹөͳͲɺ ։ൃମݧ͕Α͔ͬͨ » ͦͯ͠2021-02-27 v0.1.0͕ϦϦʔε͞Εͨ
Grizzy 0.1.0 » ٸʹه๏͕k8sελΠϧͷYAMLʹͳͬͯhidden element͕ඇਪͱͳͬͨɾɾ
Jsonnet + GrafonnetͰҾ͖ଓ͖͑·͢ (0.4.1ݱࡏ) » dashboardఆٛΛspecʹೖΕΔܗͰJsonnetͷ··ͰOK local g = import
'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonnet'; local dashboard = g.dashboard.new("my dahsboard"); ... { apiVersion: 'grizzly.grafana.com/v1alpha1', kind: 'Dashboard', metadata: { name: "dashboard name", folder: "dashboard folder" }, spec: dashboard }
grr serve(from 0.4.0) » ϩʔΧϧͰGrafanaཱͯͯϦϞʔτͷGrafanaΛ มߋ͢Δ͜ͱͳ͘μογϡϘʔυฤू͕Ͱ͖Δ » ϦΫΤετϓϩΩγ͞ΕΔͷͰϦϞʔτͷ σʔλιʔε͕͑Δ »
UI্Ͱอଘ͢ΔͱϩʔΧϧͷμογϡϘʔυ yaml͕ߋ৽͞ΕΔʢ!?ʣ » ͱΓ͋͑ͣܗΛ࡞ͬͯɺμογϡϘʔυΛखಈ ฤूͭͭ͠όʔδϣϯཧ͢ΔɺͳͲ͕Ͱ͖· ͢ɺศར
GrizzlyͷΠϚΠνͳ » Τϥʔϝοηʔδ͕ෆ » GrafanaͷΫϨσϯγϟϧ͕ෆ͍ͯ͠Δঢ়ଶͰ invalid memory address ͱ͔ੜͬΆ͍Τϥʔ͕ग़ͨΓ »
എܠͱͯ͠࠷ۙ։ൃׂ͕ͱεϐʔσΟʔʹਐΜͰͦ͏ɺ໘༷·ͩ҆ఆ͠ ͯͳ͍ » υΩϡϝϯτ͕؆ૉͰॳखͷ͍ํ͕Α͘Θ͔Βͳ͍ » ຊޠใ૿͍͖͍ͯͨ͠Ͱ͢Ͷ
࡞ͬͨμογϡϘʔυͷ հ
࡞ͬͨμογϡϘʔυͷհ » systemd_resolved » sysload » process dashbaord with treemap
࡞ͬͨμογϡϘʔυͷհ » systemd_resolvedʢ͜Εͱʣ » sysload » process dashbaord with treemapʢ͜ΕͷΛগ͠ʣ
systemd_resolved https://grafana.com/grafana/dashboards/15816-systemd-resolved-exporter/
systemd_resolved » ಄Ͱͨ͠Έͷճऩ » systemtd_resolvedͷϝτϦΫεΛऔΔͨΊʹಠཱͨ͠exporterΛ2022ʹॻ͍ͨ » https://github.com/egmc/systemd_resolved_exporter » ࣌Λܦͯcommunityϝϯςͱͳͬͨsystemd_exporterʹಉ༷ͷ࣮Λߦ͏PRΛ ೖΕͯϚʔδ͞Εͨ
» σϞ༻ʹμογϡϘʔυ࡞͚ͬͨͲ·ͩʢsystemd_exporterͷํͰʣ͑ͳ ͍ɺϦϦʔε͞ΕͨΒྑ͔ͬͨΒͬͯΈ͍ͯͩ͘͞ɾɾ
process dashbaord with treemap https://grafana.com/grafana/dashboards/13882-process-exporter-dashboard-with-treemap/
process dashbaord with treemap » DatadogͷμογϡϘʔυʹ͋ΔϝϞϦϚοϓతͳλΠϧදࣔΛߦ͏ෳ߹άϥϑ͕Α͔ͬͨͷͰਅࣅͯ࡞ͬͨ » process-exporeter2ͷϝτϦΫεΛදࣔ͢Δ » /proc
ҎԼͷใΛͱʹ » ҙʹάϧʔϐϯάͨ͠ϓϩηε͝ͱͷϝϞϦ/cpu/io/uptimeͳͲ » ݸਓతʹಛʹ͍͍ͨͷϝϞϦͷ༻ঢ়گͱͦͷมԽ » ͳ͔ͳ͔ศརʹ͑ͨͷͰࣗࣾͷڥʹ࣋ͪࠐΜͰ͍ͬͯΔ 2 process-exporter(https://github.com/ncabatoff/process-exporter)
ϝϞϦϦʔΫͷՄࢹԽͱ͔
OOMൃੜલͷঢ়گ֬ೝͱ͔
μογϡϘʔυ ͬͱڞ༗͞Εͯ΄͍͠ » ެࣜαΠτͷํগ͠վળ͞Ε͖ͯͨ » ΧςΰϦ·ΘΓ͏ͪΐ͍΄͍͠ » ͱ͍͑ݟ͚ͭΔͷେมͳͷͰڞ༗ɺ ൃ৴͕૿͑Δͱخ͍͠ »
͍͖ͬͯ·͠ΐ͏
·ͱΊ
·ͱΊ » μογϡϘʔυ։ൃָ͍͠ » ͕ɺ͋·Γ։ൃɺڞ༗ࣄྫ͕ྲྀΕͯ͜ͳ͍ʢؾ͕͢ΔʣɺͷͰڞ༗͍͖ͯ͠ ·͠ΐ͏ » πʔϧ৭ʑ͋Δ͕ɺݸਓతʹ·ͣखಈ࡞Ͱ » Grizzlyෳͷ࡞๏Ͱ͑ΔͷͰ͕͠ΒΈ͕ͳ͚Ε͓͢͢ΊͰ͢
Thank you for listening