Merge pull request #25 from thouveng/build-main-dashboard-yaml
Provides a base panel to construct the main dashboard
This commit is contained in:
commit
325e5c4ccd
5 changed files with 77 additions and 2015 deletions
|
@ -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)
|
||||||
|
|
|
@ -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
|
@ -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']
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue