]> git.proxmox.com Git - ceph.git/blob - ceph/monitoring/ceph-mixin/dashboards/utils.libsonnet
import quincy beta 17.1.0
[ceph.git] / ceph / monitoring / ceph-mixin / dashboards / utils.libsonnet
1 local g = import 'grafonnet/grafana.libsonnet';
2
3 {
4 dashboardSchema(title,
5 description,
6 uid,
7 time_from,
8 refresh,
9 schemaVersion,
10 tags,
11 timezone,
12 timepicker)::
13 g.dashboard.new(title=title,
14 description=description,
15 uid=uid,
16 time_from=time_from,
17 refresh=refresh,
18 schemaVersion=schemaVersion,
19 tags=tags,
20 timezone=timezone,
21 timepicker=timepicker),
22
23 graphPanelSchema(aliasColors,
24 title,
25 description,
26 nullPointMode,
27 stack,
28 formatY1,
29 formatY2,
30 labelY1,
31 labelY2,
32 min,
33 fill,
34 datasource,
35 legend_alignAsTable=false,
36 legend_avg=false,
37 legend_min=false,
38 legend_max=false,
39 legend_current=false,
40 legend_values=false)::
41 g.graphPanel.new(aliasColors=aliasColors,
42 title=title,
43 description=description,
44 nullPointMode=nullPointMode,
45 stack=stack,
46 formatY1=formatY1,
47 formatY2=formatY2,
48 labelY1=labelY1,
49 labelY2=labelY2,
50 min=min,
51 fill=fill,
52 datasource=datasource,
53 legend_alignAsTable=legend_alignAsTable,
54 legend_avg=legend_avg,
55 legend_min=legend_min,
56 legend_max=legend_max,
57 legend_current=legend_current,
58 legend_values=legend_values),
59
60
61 addTargetSchema(expr, intervalFactor, format, legendFormat)::
62 g.prometheus.target(expr=expr,
63 intervalFactor=intervalFactor,
64 format=format,
65 legendFormat=legendFormat),
66
67 addTemplateSchema(name,
68 datasource,
69 query,
70 refresh,
71 includeAll,
72 sort,
73 label,
74 regex)::
75 g.template.new(name=name,
76 datasource=datasource,
77 query=query,
78 refresh=refresh,
79 includeAll=includeAll,
80 sort=sort,
81 label=label,
82 regex=regex),
83
84 addAnnotationSchema(builtIn,
85 datasource,
86 enable,
87 hide,
88 iconColor,
89 name,
90 type)::
91 g.annotation.datasource(builtIn=builtIn,
92 datasource=datasource,
93 enable=enable,
94 hide=hide,
95 iconColor=iconColor,
96 name=name,
97 type=type),
98
99 addRowSchema(collapse, showTitle, title)::
100 g.row.new(collapse=collapse, showTitle=showTitle, title=title),
101
102 addSingleStatSchema(colors,
103 datasource,
104 format,
105 title,
106 description,
107 valueName,
108 colorValue,
109 gaugeMaxValue,
110 gaugeShow,
111 sparklineShow,
112 thresholds)::
113 g.singlestat.new(colors=colors,
114 datasource=datasource,
115 format=format,
116 title=title,
117 description=description,
118 valueName=valueName,
119 colorValue=colorValue,
120 gaugeMaxValue=gaugeMaxValue,
121 gaugeShow=gaugeShow,
122 sparklineShow=sparklineShow,
123 thresholds=thresholds),
124
125 addPieChartSchema(aliasColors,
126 datasource,
127 description,
128 legendType,
129 pieType,
130 title,
131 valueName)::
132 g.pieChartPanel.new(aliasColors=aliasColors,
133 datasource=datasource,
134 description=description,
135 legendType=legendType,
136 pieType=pieType,
137 title=title,
138 valueName=valueName),
139
140 addTableSchema(datasource, description, sort, styles, title, transform)::
141 g.tablePanel.new(datasource=datasource,
142 description=description,
143 sort=sort,
144 styles=styles,
145 title=title,
146 transform=transform),
147
148 addStyle(alias,
149 colorMode,
150 colors,
151 dateFormat,
152 decimals,
153 mappingType,
154 pattern,
155 thresholds,
156 type,
157 unit,
158 valueMaps)::
159 {
160 alias: alias,
161 colorMode: colorMode,
162 colors: colors,
163 dateFormat: dateFormat,
164 decimals: decimals,
165 mappingType: mappingType,
166 pattern: pattern,
167 thresholds: thresholds,
168 type: type,
169 unit: unit,
170 valueMaps: valueMaps,
171 },
172 }