local g = import 'grafonnet/grafana.libsonnet';
+
(import 'utils.libsonnet') {
'osds-overview.json':
$.dashboardSchema(
true
)
) + { gridPos: { x: 20, y: 0, w: 4, h: 8 } },
- $.simplePieChart(
- {}, '', 'OSD Types Summary'
- )
+ $.pieChartPanel('OSD Types Summary', '', '$datasource', { x: 0, y: 8, w: 4, h: 8 }, 'table', 'bottom', true, ['percent'], { mode: 'single', sort: 'none' }, 'pie', ['percent', 'value'], 'palette-classic')
.addTarget(
$.addTargetSchema('count by (device_class) (ceph_osd_metadata{%(matchers)s})' % $.matchers(), '{{device_class}}')
- ) + { gridPos: { x: 0, y: 8, w: 4, h: 8 } },
- $.simplePieChart(
- { 'Non-Encrypted': '#E5AC0E' }, '', 'OSD Objectstore Types'
- )
- .addTarget(
- $.addTargetSchema(
- 'count(ceph_bluefs_wal_total_bytes{%(matchers)s})' % $.matchers(), 'bluestore', 'time_series', 2
- )
- )
- .addTarget(
- $.addTargetSchema(
- 'absent(ceph_bluefs_wal_total_bytes{%(matchers)s}) * count(ceph_osd_metadata{%(matchers)s})' % $.matchers(), 'filestore', 'time_series', 2
- )
- ) + { gridPos: { x: 4, y: 8, w: 4, h: 8 } },
- $.simplePieChart(
- {}, 'The pie chart shows the various OSD sizes used within the cluster', 'OSD Size Summary'
- )
+ ),
+ $.pieChartPanel('OSD Objectstore Types', '', '$datasource', { x: 4, y: 8, w: 4, h: 8 }, 'table', 'bottom', true, ['percent'], { mode: 'single', sort: 'none' }, 'pie', ['percent', 'value'], 'palette-classic')
+ .addTarget($.addTargetSchema(
+ 'count(ceph_bluefs_wal_total_bytes{%(matchers)s})' % $.matchers(), 'bluestore', 'time_series', 2
+ ))
+ .addTarget($.addTargetSchema(
+ 'absent(ceph_bluefs_wal_total_bytes{job=~"$job"}) * count(ceph_osd_metadata{job=~"$job"})' % $.matchers(), 'filestore', 'time_series', 2
+ )),
+ $.pieChartPanel('OSD Size Summary', 'The pie chart shows the various OSD sizes used within the cluster', '$datasource', { x: 8, y: 8, w: 4, h: 8 }, 'table', 'bottom', true, ['percent'], { mode: 'single', sort: 'none' }, 'pie', ['percent', 'value'], 'palette-classic')
.addTarget($.addTargetSchema(
'count(ceph_osd_stat_bytes{%(matchers)s} < 1099511627776)' % $.matchers(), '<1TB', 'time_series', 2
))
))
.addTarget($.addTargetSchema(
'count(ceph_osd_stat_bytes{%(matchers)s} >= 13194139533312)' % $.matchers(), '<12TB+', 'time_series', 2
- )) + { gridPos: { x: 8, y: 8, w: 4, h: 8 } },
+ )),
g.graphPanel.new(bars=true,
datasource='$datasource',
title='Distribution of PGs per OSD',
--- /dev/null
+{
+ /**
+ * Creates a pie chart panel.
+ *
+ * @name pieChartPanel.new
+ *
+ * @param title The title of the pie chart panel.
+ * @param description (default `''`) Description of the panel
+ * @param datasource (optional) Datasource
+ * @param pieType (default `'pie'`) Type of pie chart (one of pie or donut)
+ *
+ * @method addTarget(target) Adds a target object.
+ */
+ new(
+ title,
+ description='',
+ datasource=null,
+ gridPos={},
+ displayMode='table',
+ placement='bottom',
+ showLegend=true,
+ displayLabels=[],
+ tooltip={},
+ pieType='pie',
+ values=[],
+ colorMode='auto'
+ ):: {
+ type: 'piechart',
+ [if description != null then 'description']: description,
+ title: title,
+ gridPos: gridPos,
+ datasource: datasource,
+ options: {
+ legend: {
+ calcs: [],
+ values: values,
+ displayMode: displayMode,
+ placement: placement,
+ showLegend: showLegend,
+ },
+ pieType: pieType,
+ tooltip: tooltip,
+ displayLabels: displayLabels,
+ },
+ fieldConfig: {
+ defaults: {
+ color: { mode: colorMode },
+ mappings: [],
+ custom: {
+ hideFrom: {
+ legend: false,
+ tooltip: false,
+ viz: false,
+ },
+ },
+ },
+ overrides: [],
+ },
+ targets: [
+ ],
+ _nextTarget:: 0,
+ addTarget(target):: self {
+ // automatically ref id in added targets.
+ local nextTarget = super._nextTarget,
+ _nextTarget: nextTarget + 1,
+ targets+: [target { refId: std.char(std.codepoint('A') + nextTarget) }],
+ },
+ addTargets(targets):: std.foldl(function(p, t) p.addTarget(t), targets, self),
+ },
+}
"type": "table"
},
{
- "aliasColors": { },
"datasource": "$datasource",
"description": "",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ }
+ },
+ "mappings": [ ]
+ },
+ "overrides": [ ]
+ },
"gridPos": {
"h": 8,
"w": 4,
"y": 8
},
"id": 6,
- "legend": {
- "percentage": true,
- "show": true,
- "values": true
+ "options": {
+ "displayLabels": [
+ "percent"
+ ],
+ "legend": {
+ "calcs": [ ],
+ "displayMode": "table",
+ "placement": "bottom",
+ "showLegend": true,
+ "values": [
+ "percent",
+ "value"
+ ]
+ },
+ "pieType": "pie",
+ "tooltip": {
+ "mode": "single",
+ "sort": "none"
+ }
},
- "legendType": "Under graph",
- "pieType": "pie",
"targets": [
{
"expr": "count by (device_class) (ceph_osd_metadata{job=~\"$job\"})",
}
],
"title": "OSD Types Summary",
- "type": "grafana-piechart-panel",
- "valueName": "current"
+ "type": "piechart"
},
{
- "aliasColors": {
- "Non-Encrypted": "#E5AC0E"
- },
"datasource": "$datasource",
"description": "",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ }
+ },
+ "mappings": [ ]
+ },
+ "overrides": [ ]
+ },
"gridPos": {
"h": 8,
"w": 4,
"y": 8
},
"id": 7,
- "legend": {
- "percentage": true,
- "show": true,
- "values": true
+ "options": {
+ "displayLabels": [
+ "percent"
+ ],
+ "legend": {
+ "calcs": [ ],
+ "displayMode": "table",
+ "placement": "bottom",
+ "showLegend": true,
+ "values": [
+ "percent",
+ "value"
+ ]
+ },
+ "pieType": "pie",
+ "tooltip": {
+ "mode": "single",
+ "sort": "none"
+ }
},
- "legendType": "Under graph",
- "pieType": "pie",
"targets": [
{
"expr": "count(ceph_bluefs_wal_total_bytes{job=~\"$job\"})",
}
],
"title": "OSD Objectstore Types",
- "type": "grafana-piechart-panel",
- "valueName": "current"
+ "type": "piechart"
},
{
- "aliasColors": { },
"datasource": "$datasource",
"description": "The pie chart shows the various OSD sizes used within the cluster",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ }
+ },
+ "mappings": [ ]
+ },
+ "overrides": [ ]
+ },
"gridPos": {
"h": 8,
"w": 4,
"y": 8
},
"id": 8,
- "legend": {
- "percentage": true,
- "show": true,
- "values": true
+ "options": {
+ "displayLabels": [
+ "percent"
+ ],
+ "legend": {
+ "calcs": [ ],
+ "displayMode": "table",
+ "placement": "bottom",
+ "showLegend": true,
+ "values": [
+ "percent",
+ "value"
+ ]
+ },
+ "pieType": "pie",
+ "tooltip": {
+ "mode": "single",
+ "sort": "none"
+ }
},
- "legendType": "Under graph",
- "pieType": "pie",
"targets": [
{
"expr": "count(ceph_osd_stat_bytes{job=~\"$job\"} < 1099511627776)",
}
],
"title": "OSD Size Summary",
- "type": "grafana-piechart-panel",
- "valueName": "current"
+ "type": "piechart"
},
{
"aliasColors": { },