Skip to content

Add "gauge" presentation to the monitoring dashboards

Problem to solve

Grafana has a "gauge" representation for single stat panels, akin to that of a car's instrument dashboard.

This type of single stat panel can be configured with thresholds to represent a X number of thresholds, these thresholds are represented by colors, similar to how for example a gauge in your car represents if your fuel is empty or not, as you're getting close to empty the gauge gets closer to a red color indicating the possibility of getting stranded in the road.

Proposed dashboard yml format

dashboard: 'Dashboard Title'
panel_groups:
  - group: 'Group Title'
    panels:
      - title: "Gauge"
        type: "gauge-chart"
        min_value: 0
        max_value: 100
        split: 20
        thresholds:
          mode: percentage # or absolute
          values: [65, 95]
        format: "kilobytes"
        metrics:
          - query: 'max(go_memstats_alloc_bytes{job="prometheus"})'
          - unit: kb
  • if both of min_value and max_value are not defined, they will default to min_value: 0 and max_value: 100
  • if a threshold is not defined, a default threshold will be set at 90% of the range between min-value and max-value
  • threshold mode defaults to absolute if not set or if its values are all invalid
  • split defaults to 10

Intended users

Further details

We should evaluate if we should have this gauges as part of our single stat panel component or maybe use a different component altogether. Echarts has some examples of gauge charts here

Proposal

This issue covers the implementation of the gauge chart into the metrics dashboard.

Testing and Availability

End to end feature coverage by gitlab-org/quality/testcases#881 (closed)

Edited by Andrei Stoicescu