From 3d0283a0cd6d1effb23675d8ccdc9caf221c1a6e Mon Sep 17 00:00:00 2001 From: Pedro Gonzalez Gomez Date: Mon, 10 Mar 2025 22:09:08 +0100 Subject: [PATCH] monitoring: add SMB overview grafana dashboard Fixes: https://tracker.ceph.com/issues/70423 Signed-off-by: Pedro Gonzalez Gomez --- monitoring/ceph-mixin/dashboards.libsonnet | 1 + .../dashboards/smb-overview.libsonnet | 403 +++++++ .../dashboards_out/smb-overview.json | 1013 +++++++++++++++++ .../smb-overview/smb-overview.component.html | 8 + .../smb-overview/smb-overview.component.scss | 0 .../smb-overview.component.spec.ts | 27 + .../smb-overview/smb-overview.component.ts | 8 + .../ceph/smb/smb-tabs/smb-tabs.component.html | 10 + .../smb/smb-tabs/smb-tabs.component.spec.ts | 3 +- .../ceph/smb/smb-tabs/smb-tabs.component.ts | 3 +- .../frontend/src/app/ceph/smb/smb.module.ts | 4 +- 11 files changed, 1477 insertions(+), 3 deletions(-) create mode 100644 monitoring/ceph-mixin/dashboards/smb-overview.libsonnet create mode 100644 monitoring/ceph-mixin/dashboards_out/smb-overview.json create mode 100644 src/pybind/mgr/dashboard/frontend/src/app/ceph/smb/smb-overview/smb-overview.component.html create mode 100644 src/pybind/mgr/dashboard/frontend/src/app/ceph/smb/smb-overview/smb-overview.component.scss create mode 100644 src/pybind/mgr/dashboard/frontend/src/app/ceph/smb/smb-overview/smb-overview.component.spec.ts create mode 100644 src/pybind/mgr/dashboard/frontend/src/app/ceph/smb/smb-overview/smb-overview.component.ts diff --git a/monitoring/ceph-mixin/dashboards.libsonnet b/monitoring/ceph-mixin/dashboards.libsonnet index 82e1888e036..ff36be46491 100644 --- a/monitoring/ceph-mixin/dashboards.libsonnet +++ b/monitoring/ceph-mixin/dashboards.libsonnet @@ -9,5 +9,6 @@ (import 'dashboards/ceph-cluster.libsonnet') + (import 'dashboards/rgw-s3-analytics.libsonnet') + (import 'dashboards/multi-cluster.libsonnet') + + (import 'dashboards/smb-overview.libsonnet') + { _config:: $._config }, } diff --git a/monitoring/ceph-mixin/dashboards/smb-overview.libsonnet b/monitoring/ceph-mixin/dashboards/smb-overview.libsonnet new file mode 100644 index 00000000000..8d16332c874 --- /dev/null +++ b/monitoring/ceph-mixin/dashboards/smb-overview.libsonnet @@ -0,0 +1,403 @@ +local g = import 'grafonnet/grafana.libsonnet'; + +(import 'utils.libsonnet') { + 'smb-overview.json': + $.dashboardSchema( + 'SMB Overview', + 'SMB Overview dashboard shows data across all clusters and hosts associated with the SMB service.', + 'feem6ehrmi2o0b', + 'now-6h', + '30s', + 22, + $._config.dashboardTags, + '' + ) + .addAnnotation( + $.addAnnotationSchema( + 1, + '-- Grafana --', + true, + true, + 'rgba(0, 211, 255, 1)', + 'Annotations & Alerts', + 'dashboard' + ) + ) + .addTemplate( + g.template.datasource('datasource', 'prometheus', 'default', label='Data Source') + ) + .addTemplate( + $.addTemplateSchema('Cluster', + '$datasource', + 'label_values(ceph_health_status, cluster)', + 2, + false, + 0, + null, + '') + ) + .addTemplate( + $.addTemplateSchema( + 'SMBcluster', + '$datasource', + 'label_values(smb_metrics_status,netbiosname)', + 1, + true, + 1, + 'SMB Cluster', + null, + ) + ) + .addTemplate( + $.addTemplateSchema( + 'hostname', + '$datasource', + 'label_values(smb_metrics_status{netbiosname=~"$SMBcluster"},instance)', + 1, + true, + 1, + 'Hostname', + null, + current='All' + ) + ) + .addPanels([ + $.addStatPanel( + title='Prometheus SMB metrics status', + description='SMB metrics daemon health.', + datasource='${datasource}', + unit='short', + gridPosition={ x: 0, y: 0, w: 8, h: 8 }, + graphMode='none', + colorMode='background', + orientation='auto', + justifyMode='auto', + thresholdsMode='absolute', + pluginVersion='9.4.7', + ) + .addMappings([ + { + options: { + '0': { text: 'Down', color: 'red' }, + '1': { text: 'Up', color: 'green' }, + }, + type: 'value', + }, + ]). + addThresholds([ + { color: 'green', value: null }, + { color: 'red', value: 80 }, + ]) + .addTargets([ + $.addTargetSchema( + expr='sum(smb_metrics_status{instance=~"$hostname"}) by (instance)', + datasource='${datasource}', + instant=false, + legendFormat='__auto', + range=true + ), + ]), + $.addStatPanel( + title='Nodes per Cluster', + description='Number of nodes per cluster', + datasource='${datasource}', + unit='none', + gridPosition={ x: 8, y: 0, w: 8, h: 4 }, + graphMode='none', + colorMode='none', + orientation='auto', + justifyMode='auto', + thresholdsMode='absolute', + pluginVersion='9.4.7', + ). + addThresholds([ + { color: 'green', value: null }, + { color: 'red', value: 80 }, + ]) + .addTargets([ + $.addTargetSchema( + expr='count by (netbiosname) (smb_sessions_total * on (instance) group_left (netbiosname) smb_metrics_status{netbiosname=~"$SMBcluster"})', + datasource='${datasource}', + instant=false, + legendFormat='__auto', + range=true + ), + ]), + $.addStatPanel( + title='Active sessions per Cluster', + description='Number of users currently logged in Cluster', + datasource='${datasource}', + unit='none', + gridPosition={ x: 16, y: 0, w: 8, h: 4 }, + graphMode='none', + colorMode='none', + orientation='auto', + justifyMode='auto', + thresholdsMode='absolute', + pluginVersion='9.4.7', + ). + addThresholds([ + { color: 'green', value: null }, + { color: 'red', value: 80 }, + ]) + .addTargets([ + $.addTargetSchema( + expr='sum by(netbiosname)(smb_sessions_total * on (instance) group_left (netbiosname) smb_metrics_status{netbiosname=~"$SMBcluster"}) / (count by ( netbiosname)(smb_sessions_total * on (instance) group_left (netbiosname) smb_metrics_status{netbiosname=~"$SMBcluster"}))', + datasource='${datasource}', + exemplar=false, + instant=false, + legendFormat='__auto', + range=true + ), + ]), + $.addStatPanel( + title='Shares activity per Cluster', + description='Number of remote machines using a share in cluster', + datasource='${datasource}', + gridPosition={ x: 8, y: 4, w: 8, h: 4 }, + graphMode='none', + colorMode='none', + orientation='auto', + justifyMode='auto', + thresholdsMode='absolute', + pluginVersion='9.4.7', + ). + addThresholds([ + { color: 'green', value: null }, + { color: 'red', value: 80 }, + ]) + .addTargets([ + $.addTargetSchema( + expr='sum by(netbiosname)(smb_share_activity * on (instance) group_left (netbiosname) smb_metrics_status{netbiosname=~"$SMBcluster"}) / (count by ( netbiosname)(smb_share_activity * on (instance) group_left (netbiosname) smb_metrics_status{netbiosname=~"$SMBcluster"}))', + datasource='${datasource}', + exemplar=false, + instant=false, + legendFormat='__auto', + range=true + ), + ]), + $.addStatPanel( + title='Active users per Cluster', + description='Number of currently active SMB user per cluster', + datasource='${datasource}', + gridPosition={ x: 16, y: 4, w: 8, h: 4 }, + graphMode='none', + colorMode='none', + orientation='auto', + justifyMode='auto', + thresholdsMode='absolute', + pluginVersion='9.4.7', + ). + addThresholds([ + { color: 'green', value: null }, + { color: 'red', value: 80 }, + ]) + .addTargets([ + $.addTargetSchema( + expr='sum by(netbiosname)(smb_users_total * on (instance) group_left (netbiosname) smb_metrics_status{netbiosname=~"$SMBcluster"}) / (count by ( netbiosname)(smb_users_total * on (instance) group_left (netbiosname) smb_metrics_status{netbiosname=~"$SMBcluster"}))', + datasource='${datasource}', + exemplar=false, + instant=false, + legendFormat='__auto', + range=true + ), + ]), + $.addStatPanel( + title='Ingress throughtput', + description='Current total ingress throughput, bytes going in per second', + datasource='${datasource}', + unit='decbytes', + gridPosition={ x: 0, y: 8, w: 6, h: 5 }, + graphMode='none', + colorMode='none', + orientation='auto', + justifyMode='auto', + thresholdsMode='absolute', + pluginVersion='9.4.7', + ). + addThresholds([ + { color: 'green', value: null }, + { color: 'red', value: 80 }, + ]) + .addTargets([ + $.addTargetSchema( + expr='sum(rate(smb_smb2_request_inbytes{instance=~"$hostname"}[$__rate_interval]))', + datasource='${datasource}', + exemplar=false, + instant=false, + legendFormat='__auto', + range=true + ), + ]), + $.addStatPanel( + title='Latency', + description='Current total request time for the sum of all runing operations', + datasource='${datasource}', + unit='µs', + gridPosition={ x: 6, y: 8, w: 6, h: 5 }, + graphMode='none', + colorMode='none', + orientation='auto', + justifyMode='auto', + thresholdsMode='absolute', + pluginVersion='9.4.7', + ). + addThresholds([ + { color: 'green', value: null }, + { color: 'red', value: 80 }, + ]) + .addTargets([ + $.addTargetSchema( + expr='sum(rate(smb_smb2_request_duration_microseconds_sum{instance=~"$hostname"}[$__rate_interval]))', + datasource='${datasource}', + exemplar=false, + instant=false, + legendFormat='__auto', + range=true + ), + ]), + $.addStatPanel( + title='Egress throughtput', + description='Current total egress throughput, bytes going out per second', + datasource='${datasource}', + unit='decbytes', + gridPosition={ x: 12, y: 8, w: 6, h: 5 }, + graphMode='none', + colorMode='none', + orientation='auto', + justifyMode='auto', + thresholdsMode='absolute', + pluginVersion='9.4.7', + ). + addThresholds([ + { color: 'green', value: null }, + { color: 'red', value: 80 }, + ]) + .addTargets([ + $.addTargetSchema( + expr='sum(rate(smb_smb2_request_outbytes{instance=~"$hostname"}[$__rate_interval]))', + datasource='${datasource}', + exemplar=false, + instant=false, + legendFormat='__auto', + range=true + ), + ]), + + $.addStatPanel( + title='I/O', + description='Current total number of operations per second', + datasource='${datasource}', + unit='short', + gridPosition={ x: 18, y: 8, w: 6, h: 5 }, + graphMode='none', + colorMode='none', + orientation='auto', + justifyMode='auto', + thresholdsMode='absolute', + pluginVersion='9.4.7', + ). + addThresholds([ + { color: 'green', value: null }, + { color: 'red', value: 80 }, + ]) + .addTargets([ + $.addTargetSchema( + expr='sum(rate(smb_smb2_request_outbytes{instance=~"$hostname"}[$__rate_interval]))', + datasource='${datasource}', + exemplar=false, + instant=false, + legendFormat='__auto', + range=true + ), + ]), + $.timeSeriesPanel( + title='Throughput', + datasource='${datasource}', + gridPosition={ x: 0, y: 13, w: 12, h: 9 }, + lineWidth=1, + fillOpacity=8, + pointSize=5, + showPoints='auto', + unit='decbytes', + displayMode='table', + placement='right', + tooltip={ mode: 'single', sort: 'none' }, + stackingMode='none', + decimals=2, + sortBy='Last *', + sortDesc=true + ) + .addCalcs(['lastNotNull']) + .addTargets([ + $.addTargetSchema( + expr='rate(smb_smb2_request_inbytes{instance=~"$hostname"}[$__rate_interval])', + datasource='${datasource}', + instant=false, + legendFormat='Inbytes.{{instance}}.{{operation}}', + range=true, + ), + $.addTargetSchema( + expr='rate(smb_smb2_request_outbytes{instance=~"$hostname"}[$__rate_interval])', + datasource='${datasource}', + instant=false, + legendFormat='Outbytes.{{instance}}.{{operation}}', + range=true, + hide=false + ), + ]), + $.timeSeriesPanel( + title='I/O', + datasource='${datasource}', + gridPosition={ x: 12, y: 13, w: 12, h: 9 }, + lineWidth=1, + fillOpacity=8, + pointSize=5, + showPoints='auto', + displayMode='table', + placement='right', + tooltip={ mode: 'single', sort: 'none' }, + stackingMode='none', + decimals=2, + sortBy='Last *', + sortDesc=true + ) + .addCalcs(['lastNotNull']) + .addTargets([ + $.addTargetSchema( + expr='rate(smb_smb2_request_total{instance=~"$hostname"}[$__rate_interval])', + datasource='${datasource}', + instant=false, + legendFormat='{{instance}}.{{operation}}', + range=true, + ), + ]), + $.timeSeriesPanel( + title='Latencies', + datasource='${datasource}', + gridPosition={ x: 0, y: 22, w: 12, h: 9 }, + lineWidth=1, + fillOpacity=8, + pointSize=5, + showPoints='auto', + unit='µs', + displayMode='table', + placement='right', + tooltip={ mode: 'single', sort: 'none' }, + stackingMode='none', + decimals=2, + sortBy='Last *', + sortDesc=true + ) + .addCalcs(['lastNotNull']) + .addTargets([ + $.addTargetSchema( + expr='rate(smb_smb2_request_duration_microseconds_sum{instance=~"$hostname"}[$__rate_interval])', + datasource='${datasource}', + instant=false, + legendFormat='{{instance}}.{{operation}}', + range=true, + ), + ]), + ]), +} diff --git a/monitoring/ceph-mixin/dashboards_out/smb-overview.json b/monitoring/ceph-mixin/dashboards_out/smb-overview.json new file mode 100644 index 00000000000..e6f31d68d8f --- /dev/null +++ b/monitoring/ceph-mixin/dashboards_out/smb-overview.json @@ -0,0 +1,1013 @@ +{ + "__inputs": [ ], + "__requires": [ ], + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "showIn": 0, + "tags": [ ], + "type": "dashboard" + } + ] + }, + "description": "SMB Overview dashboard shows data across all clusters and hosts associated with the SMB service.", + "editable": false, + "gnetId": null, + "graphTooltip": 0, + "hideControls": false, + "id": null, + "links": [ ], + "panels": [ + { + "colors": null, + "datasource": "${datasource}", + "description": "SMB metrics daemon health.", + "fieldConfig": { + "defaults": { + "decimals": 0, + "links": [ ], + "mappings": [ + { + "id": 0, + "options": { + "0": { + "color": "red", + "text": "Down" + }, + "1": { + "color": "green", + "text": "Up" + } + }, + "type": "value" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + } + }, + "gridPos": { + "h": 8, + "w": 8, + "x": 0, + "y": 0 + }, + "id": 2, + "links": [ ], + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "textMode": "auto" + }, + "pluginVersion": "9.4.7", + "targets": [ + { + "datasource": "${datasource}", + "expr": "sum(smb_metrics_status{instance=~\"$hostname\"}) by (instance)", + "format": "time_series", + "instant": false, + "intervalFactor": 1, + "legendFormat": "__auto", + "range": true, + "refId": "A" + } + ], + "title": "Prometheus SMB metrics status", + "transparent": false, + "type": "stat" + }, + { + "colors": null, + "datasource": "${datasource}", + "description": "Number of nodes per cluster", + "fieldConfig": { + "defaults": { + "decimals": 0, + "links": [ ], + "mappings": [ ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "none" + } + }, + "gridPos": { + "h": 4, + "w": 8, + "x": 8, + "y": 0 + }, + "id": 3, + "links": [ ], + "options": { + "colorMode": "none", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "textMode": "auto" + }, + "pluginVersion": "9.4.7", + "targets": [ + { + "datasource": "${datasource}", + "expr": "count by (netbiosname) (smb_sessions_total * on (instance) group_left (netbiosname) smb_metrics_status{netbiosname=~\"$SMBcluster\"})", + "format": "time_series", + "instant": false, + "intervalFactor": 1, + "legendFormat": "__auto", + "range": true, + "refId": "A" + } + ], + "title": "Nodes per Cluster", + "transparent": false, + "type": "stat" + }, + { + "colors": null, + "datasource": "${datasource}", + "description": "Number of users currently logged in Cluster", + "fieldConfig": { + "defaults": { + "decimals": 0, + "links": [ ], + "mappings": [ ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "none" + } + }, + "gridPos": { + "h": 4, + "w": 8, + "x": 16, + "y": 0 + }, + "id": 4, + "links": [ ], + "options": { + "colorMode": "none", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "textMode": "auto" + }, + "pluginVersion": "9.4.7", + "targets": [ + { + "datasource": "${datasource}", + "exemplar": false, + "expr": "sum by(netbiosname)(smb_sessions_total * on (instance) group_left (netbiosname) smb_metrics_status{netbiosname=~\"$SMBcluster\"}) / (count by ( netbiosname)(smb_sessions_total * on (instance) group_left (netbiosname) smb_metrics_status{netbiosname=~\"$SMBcluster\"}))", + "format": "time_series", + "instant": false, + "intervalFactor": 1, + "legendFormat": "__auto", + "range": true, + "refId": "A" + } + ], + "title": "Active sessions per Cluster", + "transparent": false, + "type": "stat" + }, + { + "colors": null, + "datasource": "${datasource}", + "description": "Number of remote machines using a share in cluster", + "fieldConfig": { + "defaults": { + "decimals": 0, + "links": [ ], + "mappings": [ ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "none" + } + }, + "gridPos": { + "h": 4, + "w": 8, + "x": 8, + "y": 4 + }, + "id": 5, + "links": [ ], + "options": { + "colorMode": "none", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "textMode": "auto" + }, + "pluginVersion": "9.4.7", + "targets": [ + { + "datasource": "${datasource}", + "exemplar": false, + "expr": "sum by(netbiosname)(smb_share_activity * on (instance) group_left (netbiosname) smb_metrics_status{netbiosname=~\"$SMBcluster\"}) / (count by ( netbiosname)(smb_share_activity * on (instance) group_left (netbiosname) smb_metrics_status{netbiosname=~\"$SMBcluster\"}))", + "format": "time_series", + "instant": false, + "intervalFactor": 1, + "legendFormat": "__auto", + "range": true, + "refId": "A" + } + ], + "title": "Shares activity per Cluster", + "transparent": false, + "type": "stat" + }, + { + "colors": null, + "datasource": "${datasource}", + "description": "Number of currently active SMB user per cluster", + "fieldConfig": { + "defaults": { + "decimals": 0, + "links": [ ], + "mappings": [ ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "none" + } + }, + "gridPos": { + "h": 4, + "w": 8, + "x": 16, + "y": 4 + }, + "id": 6, + "links": [ ], + "options": { + "colorMode": "none", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "textMode": "auto" + }, + "pluginVersion": "9.4.7", + "targets": [ + { + "datasource": "${datasource}", + "exemplar": false, + "expr": "sum by(netbiosname)(smb_users_total * on (instance) group_left (netbiosname) smb_metrics_status{netbiosname=~\"$SMBcluster\"}) / (count by ( netbiosname)(smb_users_total * on (instance) group_left (netbiosname) smb_metrics_status{netbiosname=~\"$SMBcluster\"}))", + "format": "time_series", + "instant": false, + "intervalFactor": 1, + "legendFormat": "__auto", + "range": true, + "refId": "A" + } + ], + "title": "Active users per Cluster", + "transparent": false, + "type": "stat" + }, + { + "colors": null, + "datasource": "${datasource}", + "description": "Current total ingress throughput, bytes going in per second", + "fieldConfig": { + "defaults": { + "decimals": 0, + "links": [ ], + "mappings": [ ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "decbytes" + } + }, + "gridPos": { + "h": 5, + "w": 6, + "x": 0, + "y": 8 + }, + "id": 7, + "links": [ ], + "options": { + "colorMode": "none", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "textMode": "auto" + }, + "pluginVersion": "9.4.7", + "targets": [ + { + "datasource": "${datasource}", + "exemplar": false, + "expr": "sum(rate(smb_smb2_request_inbytes{instance=~\"$hostname\"}[$__rate_interval]))", + "format": "time_series", + "instant": false, + "intervalFactor": 1, + "legendFormat": "__auto", + "range": true, + "refId": "A" + } + ], + "title": "Ingress throughtput", + "transparent": false, + "type": "stat" + }, + { + "colors": null, + "datasource": "${datasource}", + "description": "Current total request time for the sum of all runing operations", + "fieldConfig": { + "defaults": { + "decimals": 0, + "links": [ ], + "mappings": [ ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "µs" + } + }, + "gridPos": { + "h": 5, + "w": 6, + "x": 6, + "y": 8 + }, + "id": 8, + "links": [ ], + "options": { + "colorMode": "none", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "textMode": "auto" + }, + "pluginVersion": "9.4.7", + "targets": [ + { + "datasource": "${datasource}", + "exemplar": false, + "expr": "sum(rate(smb_smb2_request_duration_microseconds_sum{instance=~\"$hostname\"}[$__rate_interval]))", + "format": "time_series", + "instant": false, + "intervalFactor": 1, + "legendFormat": "__auto", + "range": true, + "refId": "A" + } + ], + "title": "Latency", + "transparent": false, + "type": "stat" + }, + { + "colors": null, + "datasource": "${datasource}", + "description": "Current total egress throughput, bytes going out per second", + "fieldConfig": { + "defaults": { + "decimals": 0, + "links": [ ], + "mappings": [ ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "decbytes" + } + }, + "gridPos": { + "h": 5, + "w": 6, + "x": 12, + "y": 8 + }, + "id": 9, + "links": [ ], + "options": { + "colorMode": "none", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "textMode": "auto" + }, + "pluginVersion": "9.4.7", + "targets": [ + { + "datasource": "${datasource}", + "exemplar": false, + "expr": "sum(rate(smb_smb2_request_outbytes{instance=~\"$hostname\"}[$__rate_interval]))", + "format": "time_series", + "instant": false, + "intervalFactor": 1, + "legendFormat": "__auto", + "range": true, + "refId": "A" + } + ], + "title": "Egress throughtput", + "transparent": false, + "type": "stat" + }, + { + "colors": null, + "datasource": "${datasource}", + "description": "Current total number of operations per second", + "fieldConfig": { + "defaults": { + "decimals": 0, + "links": [ ], + "mappings": [ ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + } + }, + "gridPos": { + "h": 5, + "w": 6, + "x": 18, + "y": 8 + }, + "id": 10, + "links": [ ], + "options": { + "colorMode": "none", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "textMode": "auto" + }, + "pluginVersion": "9.4.7", + "targets": [ + { + "datasource": "${datasource}", + "exemplar": false, + "expr": "sum(rate(smb_smb2_request_outbytes{instance=~\"$hostname\"}[$__rate_interval]))", + "format": "time_series", + "instant": false, + "intervalFactor": 1, + "legendFormat": "__auto", + "range": true, + "refId": "A" + } + ], + "title": "I/O", + "transparent": false, + "type": "stat" + }, + { + "datasource": "${datasource}", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 8, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "decimals": 2, + "thresholds": { + "mode": "absolute", + "steps": [ ] + }, + "unit": "decbytes" + }, + "overrides": [ ] + }, + "gridPos": { + "h": 9, + "w": 12, + "x": 0, + "y": 13 + }, + "id": 11, + "options": { + "legend": { + "calcs": [ + "lastNotNull" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Last *", + "sortDesc": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "9.1.3", + "targets": [ + { + "datasource": "${datasource}", + "expr": "rate(smb_smb2_request_inbytes{instance=~\"$hostname\"}[$__rate_interval])", + "format": "time_series", + "instant": false, + "intervalFactor": 1, + "legendFormat": "Inbytes.{{instance}}.{{operation}}", + "range": true, + "refId": "A" + }, + { + "datasource": "${datasource}", + "expr": "rate(smb_smb2_request_outbytes{instance=~\"$hostname\"}[$__rate_interval])", + "format": "time_series", + "hide": false, + "instant": false, + "intervalFactor": 1, + "legendFormat": "Outbytes.{{instance}}.{{operation}}", + "range": true, + "refId": "B" + } + ], + "title": "Throughput", + "type": "timeseries" + }, + { + "datasource": "${datasource}", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 8, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "decimals": 2, + "thresholds": { + "mode": "absolute", + "steps": [ ] + }, + "unit": "none" + }, + "overrides": [ ] + }, + "gridPos": { + "h": 9, + "w": 12, + "x": 12, + "y": 13 + }, + "id": 12, + "options": { + "legend": { + "calcs": [ + "lastNotNull" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Last *", + "sortDesc": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "9.1.3", + "targets": [ + { + "datasource": "${datasource}", + "expr": "rate(smb_smb2_request_total{instance=~\"$hostname\"}[$__rate_interval])", + "format": "time_series", + "instant": false, + "intervalFactor": 1, + "legendFormat": "{{instance}}.{{operation}}", + "range": true, + "refId": "A" + } + ], + "title": "I/O", + "type": "timeseries" + }, + { + "datasource": "${datasource}", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 8, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "decimals": 2, + "thresholds": { + "mode": "absolute", + "steps": [ ] + }, + "unit": "µs" + }, + "overrides": [ ] + }, + "gridPos": { + "h": 9, + "w": 12, + "x": 0, + "y": 22 + }, + "id": 13, + "options": { + "legend": { + "calcs": [ + "lastNotNull" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Last *", + "sortDesc": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "9.1.3", + "targets": [ + { + "datasource": "${datasource}", + "expr": "rate(smb_smb2_request_duration_microseconds_sum{instance=~\"$hostname\"}[$__rate_interval])", + "format": "time_series", + "instant": false, + "intervalFactor": 1, + "legendFormat": "{{instance}}.{{operation}}", + "range": true, + "refId": "A" + } + ], + "title": "Latencies", + "type": "timeseries" + } + ], + "refresh": "30s", + "rows": [ ], + "schemaVersion": 22, + "style": "dark", + "tags": [ + "ceph-mixin" + ], + "templating": { + "list": [ + { + "current": { + "text": "default", + "value": "default" + }, + "hide": 0, + "label": "Data Source", + "name": "datasource", + "options": [ ], + "query": "prometheus", + "refresh": 1, + "regex": "", + "type": "datasource" + }, + { + "allValue": null, + "current": { }, + "datasource": "$datasource", + "hide": 0, + "includeAll": false, + "label": null, + "multi": false, + "name": "Cluster", + "options": [ ], + "query": "label_values(ceph_health_status, cluster)", + "refresh": 2, + "regex": "", + "sort": 0, + "tagValuesQuery": "", + "tags": [ ], + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "allValue": null, + "current": { }, + "datasource": "$datasource", + "hide": 0, + "includeAll": true, + "label": "SMB Cluster", + "multi": false, + "name": "SMBcluster", + "options": [ ], + "query": "label_values(smb_metrics_status,netbiosname)", + "refresh": 1, + "regex": null, + "sort": 1, + "tagValuesQuery": "", + "tags": [ ], + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "allValue": null, + "current": { + "text": "All", + "value": "All" + }, + "datasource": "$datasource", + "hide": 0, + "includeAll": true, + "label": "Hostname", + "multi": false, + "name": "hostname", + "options": [ ], + "query": "label_values(smb_metrics_status{netbiosname=~\"$SMBcluster\"},instance)", + "refresh": 1, + "regex": null, + "sort": 1, + "tagValuesQuery": "", + "tags": [ ], + "tagsQuery": "", + "type": "query", + "useTags": false + } + ] + }, + "time": { + "from": "now-6h", + "to": "now" + }, + "timepicker": { + "refresh_intervals": [ + "5s", + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ], + "time_options": [ + "5m", + "15m", + "1h", + "6h", + "12h", + "24h", + "2d", + "7d", + "30d" + ] + }, + "timezone": "", + "title": "SMB Overview", + "uid": "feem6ehrmi2o0b", + "version": 0 +} diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/smb/smb-overview/smb-overview.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/smb/smb-overview/smb-overview.component.html new file mode 100644 index 00000000000..df5d7665d5a --- /dev/null +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/smb/smb-overview/smb-overview.component.html @@ -0,0 +1,8 @@ + + diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/smb/smb-overview/smb-overview.component.scss b/src/pybind/mgr/dashboard/frontend/src/app/ceph/smb/smb-overview/smb-overview.component.scss new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/smb/smb-overview/smb-overview.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/smb/smb-overview/smb-overview.component.spec.ts new file mode 100644 index 00000000000..ec3d2a23936 --- /dev/null +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/smb/smb-overview/smb-overview.component.spec.ts @@ -0,0 +1,27 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { SmbOverviewComponent } from './smb-overview.component'; +import { SharedModule } from '~/app/shared/shared.module'; +import { provideHttpClient } from '@angular/common/http'; +import { provideHttpClientTesting } from '@angular/common/http/testing'; + +describe('SmbOverviewComponent', () => { + let component: SmbOverviewComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [SharedModule], + declarations: [SmbOverviewComponent], + providers: [provideHttpClient(), provideHttpClientTesting()] + }).compileComponents(); + + fixture = TestBed.createComponent(SmbOverviewComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/smb/smb-overview/smb-overview.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/smb/smb-overview/smb-overview.component.ts new file mode 100644 index 00000000000..46249e11887 --- /dev/null +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/smb/smb-overview/smb-overview.component.ts @@ -0,0 +1,8 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'cd-smb-overview', + templateUrl: './smb-overview.component.html', + styleUrl: './smb-overview.component.scss' +}) +export class SmbOverviewComponent {} diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/smb/smb-tabs/smb-tabs.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/smb/smb-tabs/smb-tabs.component.html index 0eab75f42f2..bce02b277d0 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/smb/smb-tabs/smb-tabs.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/smb/smb-tabs/smb-tabs.component.html @@ -51,6 +51,12 @@ i18n-heading (selected)="onSelected(Tabs.usersgroups)"> + + @@ -64,3 +70,7 @@ + + + + diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/smb/smb-tabs/smb-tabs.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/smb/smb-tabs/smb-tabs.component.spec.ts index f5f41da37d0..09c7b5550a1 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/smb/smb-tabs/smb-tabs.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/smb/smb-tabs/smb-tabs.component.spec.ts @@ -23,10 +23,11 @@ describe('SmbTabsComponent', () => { it('should display the heading text in the tab', () => { const tabs = fixture.debugElement.queryAll(By.css('cds-tab')); - expect(tabs.length).toBe(3); + expect(tabs.length).toBe(4); expect(tabs[0].attributes['heading']).toBe('Clusters'); expect(tabs[1].attributes['heading']).toBe('Active Directory'); expect(tabs[2].attributes['heading']).toBe('Standalone'); + expect(tabs[3].attributes['heading']).toBe('Overview'); }); // If the tabs cacheActive is set to true data for all tabs will be fetched at once, diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/smb/smb-tabs/smb-tabs.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/smb/smb-tabs/smb-tabs.component.ts index 48a073e2f0d..3d7584007a4 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/smb/smb-tabs/smb-tabs.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/smb/smb-tabs/smb-tabs.component.ts @@ -3,7 +3,8 @@ import { Component } from '@angular/core'; enum TABS { 'clusters', 'joinAuths', - 'usersgroups' + 'usersgroups', + 'overview' } @Component({ diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/smb/smb.module.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/smb/smb.module.ts index d2ff1c9727e..957155ec18d 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/smb/smb.module.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/smb/smb.module.ts @@ -37,6 +37,7 @@ import { SmbJoinAuthListComponent } from './smb-join-auth-list/smb-join-auth-lis import { SmbUsersgroupsDetailsComponent } from './smb-usersgroups-details/smb-usersgroups-details.component'; import { SmbJoinAuthFormComponent } from './smb-join-auth-form/smb-join-auth-form.component'; import { SmbUsersgroupsFormComponent } from './smb-usersgroups-form/smb-usersgroups-form.component'; +import { SmbOverviewComponent } from './smb-overview/smb-overview.component'; @NgModule({ imports: [ @@ -79,7 +80,8 @@ import { SmbUsersgroupsFormComponent } from './smb-usersgroups-form/smb-usersgro SmbUsersgroupsDetailsComponent, SmbJoinAuthFormComponent, SmbUsersgroupsFormComponent, - SmbShareFormComponent + SmbShareFormComponent, + SmbOverviewComponent ] }) export class SmbModule { -- 2.39.5