1
0
Fork 0
mirror of synced 2024-12-22 06:31:06 -05:00

Merge pull request #25 from thouveng/build-main-dashboard-yaml

Provides a base panel to construct the main dashboard
This commit is contained in:
Aleš Komárek 2017-02-06 18:06:36 +01:00 committed by GitHub
commit 325e5c4ccd
5 changed files with 77 additions and 2015 deletions

View file

@ -128,7 +128,8 @@ def present(name,
# Build out all dashboard fields
new_dashboard = _inherited_dashboard(
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', [])
for i, row in enumerate(rows):
rows[i] = _inherited_row(row, base_rows_from_pillar, ret)

View file

@ -76,6 +76,15 @@ grafana_client_dashboard_{{ dashboard_name }}:
- dashboard_format: json
{%- else %}
- 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 %}
{%- else %}
grafana_client_dashboard_{{ dashboard_name }}:

File diff suppressed because it is too large Load diff

View file

@ -3,5 +3,7 @@ dashboard:
format: json
template: grafana/files/grafana_dashboards/grafana_influxdb.json
main:
format: json
template: grafana/files/grafana_dashboards/main_influxdb.json
format: yaml
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:
client:
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