Save 37% off PRO during our Black Friday Sale! »

docker-metrics-grafana

254c7a2e2055fe9300ea3b419c4b1cfe?s=47 maebashi
June 27, 2014

 docker-metrics-grafana

DockerコンテナのメトリクスをGrafanaで可視化
天下一InfluxDB勉強会

254c7a2e2055fe9300ea3b419c4b1cfe?s=128

maebashi

June 27, 2014
Tweet

Transcript

  1. ©ɹ2014 Internet Initiative Japan Inc. dockerίϯςφͷϝτϦοΫεΛ GrafanaͰՄࢹԽ maebashi @ IIJ

  2. ©ɹ2014 Internet Initiative Japan Inc. ݁Ռ ↓CPU Accounting Memory→ ↓Network

    traffic
  3. ©ɹ2014 Internet Initiative Japan Inc. ߏ੒ docker metricsd docker daemon

    container container container GRI InfluxDB dockerϗετ܈
  4. ©ɹ2014 Internet Initiative Japan Inc. ߏ੒ docker metricsd docker daemon

    container container container GRI InfluxDB dockerϗετ܈ dockerϗετʹ ৗற͠ɺίϯςφ ͷ৘ใΛऩू ͯ͠ฦ͢ (cgroups౳͔ΒಡΈऔΓ)
  5. ©ɹ2014 Internet Initiative Japan Inc. docker-metricsd •  githubͰެ։த – https://github.com/maebashi/docker-metricsd – GoݴޠͰهड़

  6. ©ɹ2014 Internet Initiative Japan Inc. docker-metricsd͸ϝτϦΫεΛJSONܗࣜͰฦ͢ "memory": { "failcnt": 0,

    "stats": { "unevictable": 0, "total_unevictable": 0, "total_swap": 0, "total_rss": 380928, "total_pgpgout": 681084, "total_pgpgin": 697086, "total_mapped_file": 1433600, "total_inactive_file": 38936576, "mapped_file": 1433600, "inactive_file": 38936576, "inactive_anon": 0, "hierarchical_memsw_limit": 9223372036854776000, "hierarchical_memory_limit": 9223372036854776000, "cache": 102838272, "active_file": 63901696, "active_anon": 380928, "pgpgin": 697086, "pgpgout": 681084, "rss": 380928, "swap": 0, "total_active_anon": 380928, "total_active_file": 63901696, "total_cache": 102838272, "total_inactive_anon": 0 }, "max_usage": 139268096, "usage": 104189952 }, "interfaces": { "outpackets.0": 3021223, "inbytes.0": 8228044607, "indrop.0": 0, "inerrs.0": 0, "inpackets.0": 6429687, "name.0": "eth0", "outbytes.0": 199687042, "outdrop.0": 0, "outerrs.0": 0 }, "cpuacct": { "throlling_data": {}, "cpu_usage": { "usage_in_usermode": 2.668e+10, "usage_in_kernelmode": 8.181e+10, "percpu_usage": [ 22599918565, 987624379, 65146098, 36705600, 18221767943, 5890326, 22768005795, 4033968, 218211598, 4302652, 5437296326, 23781278563, 18992360915, 18712487134, 55742891, 18522722054 ] } }
  7. ©ɹ2014 Internet Initiative Japan Inc. ߏ੒ docker metricsd docker daemon

    container container container GRI InfluxDB dockerϗετ܈ ϞχλϦϯάπʔϧͷ Ұछ docker-metricsd ͔Β৘ใΛऩूͯ͠ InfluxDBʹ౤ೖ
  8. ©ɹ2014 Internet Initiative Japan Inc. InfluxDBʹ౤ೖ •  ωετͨ͠JSONσʔλΛϑϥοτԽ – 1Ϩίʔυ50~60߲໨͘Β͍ • 

    1ίϯςφ 1 series •  docker.ίϯςφ໊ͱ͍͏໊લͷseries ͕େྔൃੜ
  9. ©ɹ2014 Internet Initiative Japan Inc. ϞχλϦϯάπʔϧ GRI •  (ओͱͯ͠)SNMPͰσʔλऩूͯ͠RRD ʹอଘ͢Δ

    – ೖྗݩɾग़ྗઌͱ΋͍Ζ͍ΖมߋՄೳ – dockerϓϥάΠϯɺinfluxdbϓϥάΠϯಉࠝ •  ϞχΧδ#6ͷࢿྉ – https://speakerdeck.com/maebashi/ monitoring-tool-gri! •  ιʔε͸githubͰެ։த – https://github.com/iij/gri!
  10. ©ɹ2014 Internet Initiative Japan Inc. ଟ਺ͷίϯςφͷτϥϑΟοΫ৘ใΛॏͶ ͋Θͤͯඳըͨ͠৔߹ͷඳը࣌ؒΛଌఆ

  11. ©ɹ2014 Internet Initiative Japan Inc. Grafana ඳը࣌ؒ series਺: 880 point਺:

    26392 (query࣌ؒ: 1.12ඵ) series਺: 21384 point਺: 854000 (query࣌ؒ: 13.7ඵ) ظؒ: Last 1h ظؒ: Last 7d
  12. ©ɹ2014 Internet Initiative Japan Inc. ໰୊఺ •  େྔͷseries, pointΛؚΉ݁ՌΛඳը͢ Δͱ͕͔͔࣌ؒΔ

    – Grafana͚ͩͰͳ͘InfluxDBͷWebUI΋ಉ༷ •  ඳըͰ͖ͯ΋ϒϥ΢β͕ۃΊͯॏ͘ͳΔ – ϝϞϦΛେྔফඅ