Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Building Dashboards as a Hobby

Building Dashboards as a Hobby

趣味のダッシュボード開発とDashboards as codeまわりのお話

Sohei Iwahori

April 24, 2024
Tweet

More Decks by Sohei Iwahori

Other Decks in Technology

Transcript

  1. who? » Sohei Iwahori (@egmc) » GREE, Inc. » Πϯϑϥ

    / Monitoring Unit Leader / Senior Lead Engineer » ओʹήʔϜͷΠϯϑϥͱ؂ࢹγεςϜ » σʔλιʔε͸ओʹPrometheus
  2. μογϡϘʔυ։ൃͷΤίγεςϜ » 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.
  3. 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 }
  4. grr serve(from 0.4.0) » ϩʔΧϧͰGrafanaཱͯͯϦϞʔτͷGrafanaΛ มߋ͢Δ͜ͱͳ͘μογϡϘʔυฤू͕Ͱ͖Δ » ϦΫΤετ͸ϓϩΩγ͞ΕΔͷͰϦϞʔτͷ σʔλιʔε͕࢖͑Δ »

    UI্Ͱอଘ͢ΔͱϩʔΧϧͷμογϡϘʔυ yaml͕ߋ৽͞ΕΔʢ!?ʣ » ͱΓ͋͑ͣ਽ܗΛ࡞ͬͯɺμογϡϘʔυΛखಈ ฤूͭͭ͠όʔδϣϯ؅ཧ͢ΔɺͳͲ͕Ͱ͖· ͢ɺศར
  5. GrizzlyͷΠϚΠνͳ఺ » Τϥʔϝοηʔδ͕ෆ਌੾ » GrafanaͷΫϨσϯγϟϧ͕ෆ଍͍ͯ͠Δঢ়ଶͰ invalid memory address ͱ͔ੜͬΆ͍Τϥʔ͕ग़ͨΓ »

    എܠͱͯ͠࠷ۙ։ൃׂ͕ͱεϐʔσΟʔʹਐΜͰͦ͏ɺ൓໘࢓༷͸·ͩ҆ఆ͠ ͯͳ͍ » υΩϡϝϯτ͕؆ૉͰॳखͷ࢖͍ํ͕Α͘Θ͔Βͳ͍ » ೔ຊޠ৘ใ΋૿΍͍͖͍ͯͨ͠Ͱ͢Ͷ
  6. process dashbaord with treemap » DatadogͷμογϡϘʔυʹ͋ΔϝϞϦϚοϓతͳλΠϧදࣔΛߦ͏ෳ߹άϥϑ͕Α͔ͬͨͷͰਅࣅͯ࡞ͬͨ » process-exporeter2ͷϝτϦΫεΛදࣔ͢Δ » /proc

    ҎԼͷ৘ใΛ΋ͱʹ » ೚ҙʹάϧʔϐϯάͨ͠ϓϩηε͝ͱͷϝϞϦ/cpu/io/uptimeͳͲ » ݸਓతʹಛʹ࢖͍͍ͨͷ͸ϝϞϦͷ࢖༻ঢ়گͱͦͷมԽ » ͳ͔ͳ͔ศརʹ࢖͑ͨͷͰࣗࣾͷ؀ڥʹ΋࣋ͪࠐΜͰ࢖͍ͬͯΔ 2 process-exporter(https://github.com/ncabatoff/process-exporter)