1
0
Fork 0

Provides a base panel to construct the main dashboard

This patch adds a default panel that will be used when another service
will add a new panel into the main dashboard through grains. This is the
common part between all panels of the main dashboard.

It replaces the static main dashboard that has been removed.
This commit is contained in:
Guillaume Thouvenin 2017-01-10 17:08:26 +01:00
parent 4dab23a099
commit 885c5fc79c
5 changed files with 77 additions and 2015 deletions

View File

@ -128,7 +128,8 @@ def present(name,
# Build out all dashboard fields # Build out all dashboard fields
new_dashboard = _inherited_dashboard( new_dashboard = _inherited_dashboard(
dashboard, base_dashboards_from_pillar, ret) dashboard, base_dashboards_from_pillar, ret)
new_dashboard['title'] = name if not new_dashboard.get('title'):
new_dashboard['title'] = name
rows = new_dashboard.get('rows', []) rows = new_dashboard.get('rows', [])
for i, row in enumerate(rows): for i, row in enumerate(rows):
rows[i] = _inherited_row(row, base_rows_from_pillar, ret) rows[i] = _inherited_row(row, base_rows_from_pillar, ret)

View File

@ -76,6 +76,15 @@ grafana_client_dashboard_{{ dashboard_name }}:
- dashboard_format: json - dashboard_format: json
{%- else %} {%- else %}
- dashboard: {{ dashboard }} - dashboard: {{ dashboard }}
{%- if dashboard.base_dashboards is defined %}
- base_dashboards_from_pillar: {{ dashboard.base_dashboards|yaml }}
{%- endif %}
{%- if dashboard.base_rows is defined %}
- base_rows_from_pillar: {{ dashboard.base_rows|yaml }}
{%- endif %}
{%- if dashboard.base_panels is defined %}
- base_panels_from_pillar: {{ dashboard.base_panels|yaml }}
{%- endif %}
{%- endif %} {%- endif %}
{%- else %} {%- else %}
grafana_client_dashboard_{{ dashboard_name }}: grafana_client_dashboard_{{ dashboard_name }}:

File diff suppressed because it is too large Load Diff

View File

@ -3,5 +3,7 @@ dashboard:
format: json format: json
template: grafana/files/grafana_dashboards/grafana_influxdb.json template: grafana/files/grafana_dashboards/grafana_influxdb.json
main: main:
format: json format: yaml
template: grafana/files/grafana_dashboards/main_influxdb.json base_dashboards: ['grafana:client:base_templates:main_dashboard']
base_rows: ['grafana:client:base_templates:service_row']
base_panels: ['grafana:client:base_templates:cluster_status_singlestat']

View File

@ -4,3 +4,65 @@ parameters:
grafana: grafana:
client: client:
enabled: true enabled: true
base_templates:
main_dashboard:
title: 'Main'
editable: true
hideControls: false
templating:
enable: true
list:
- allFormat: regex values
hide: 0
includeAll: false
name: environment
options: []
query: show tag values from cpu_idle with key = environment_label
refresh: 1
refresh_on_load: true
regex: ''
type: query
sort: 0
multi: false
service_row:
showTitle: true
height: 100px
cluster_status_singlestat:
span: 2
editable: false
type: singlestat
prefixFontSize: "50%"
postfixFontSize: "50%"
colorBackground: true
colors:
- "rgba(71, 212, 59, 0.4)"
- "rgba(245, 150, 40, 0.73)"
- "rgba(225, 40, 40, 0.59)"
thresholds: "1,3"
interval: "> 60s"
sparkline:
fillColor: "rgba(31, 118, 189, 0.18)"
full: false
lineColor: "rgb(31, 120, 193)"
show: false
valueFontSize: "50%"
valueMaps:
- op: "="
text: "no data"
value: "null"
- op: "="
text: "OKAY"
value: "0"
- op: "="
text: "WARN"
value: "1"
- op: "="
text: "UNKW"
value: "2"
- op: "="
text: "CRIT"
value: "3"
- op: "="
text: "DOWN"
value: "4"
valueName: current