Visualization using Grafana - jbrucker/home-log GitHub Wiki

Video Tutorial

Creating Grafana Dashboards for Prometheus by co-developer of Prometheus.

  • How to create a time-series chart, a guage panel, and a table.
  • You can use a public Prometheus demo server at https://demo.promlabs.com to perform tasks in video.

In the tutorial, he creates a "Gauge" panel showing percentage CPU utilization (about 8:00 into video).

  • The PromQL exression for cpu usage is:
    sum by(instance) (rate(demo_cpu_usage_seconds_total{mode != "idle"}[5m])) /
        on(instance) group_left() demo_num_cpus
    
  • Specify units as % (0 - 1).
  • Optional specify custom legend.

Units

The data collected from sources like Prometheus contains only numbers. It's up to the Panel creator to specify the units.

  1. Select a Panel and choose "Edit" (3-dots in upper right corner of panel).
  2. On right side ("Visualization" side-panel) click hour-glass to search.
  3. Enter "Unit" in search box.
  4. Under Units, should suitable unit type.
    • For data, e.g. virtual memory used, choose "Data" and either Bytes(IEC) or Bytes(SI).
    • Bytes(IEC) uses powers of 2. 1 MB (should be MiB) is 2^20, 1 GB (GiB) is 2^30.
    • Bytes(SI) uses powers of 10. 1 MB is 1,000,000 bytes.
  5. When done, choose "Back to dashboard". Changes are saved when you click "Save Dashboard".
⚠️ **GitHub.com Fallback** ⚠️