From 95781a2b0a5e979c508829cac9819da6fc478160 Mon Sep 17 00:00:00 2001 From: mgirgisf Date: Mon, 9 Dec 2024 10:53:55 +0100 Subject: [PATCH 1/8] Add Network Dashboard --- controllers/metricstorage_controller.go | 1 + pkg/dashboards/openstack-network-traffic.go | 1243 +++++++++++++++++ pkg/metricstorage/dashboard_objects.go | 1 + .../suites/metricstorage/tests/01-assert.yaml | 6 + .../suites/metricstorage/tests/02-errors.yaml | 6 + 5 files changed, 1257 insertions(+) create mode 100644 pkg/dashboards/openstack-network-traffic.go diff --git a/controllers/metricstorage_controller.go b/controllers/metricstorage_controller.go index b2e49f53..16f3fbdb 100644 --- a/controllers/metricstorage_controller.go +++ b/controllers/metricstorage_controller.go @@ -777,6 +777,7 @@ func (r *MetricStorageReconciler) createDashboardObjects(ctx context.Context, in "grafana-dashboard-openstack-node": dashboards.OpenstackNode(datasourceName), "grafana-dashboard-openstack-vm": dashboards.OpenstackVM(datasourceName), "grafana-dashboard-openstack-rabbitmq": dashboards.OpenstackRabbitmq(datasourceName), + "grafana-dashboard-openstack-network-traffic": dashboards.OpenstackNetworkTraffic(datasourceName), } // atleast one nodeset must have "telemetry-power-monitoring" service enabled for kepler dashboard to be created diff --git a/pkg/dashboards/openstack-network-traffic.go b/pkg/dashboards/openstack-network-traffic.go new file mode 100644 index 00000000..91b3a8e4 --- /dev/null +++ b/pkg/dashboards/openstack-network-traffic.go @@ -0,0 +1,1243 @@ +/* +Copyright 2024. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package dashboards + +import ( + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +func OpenstackNetworkTraffic(dsName string) *corev1.ConfigMap { + dashboardCM := &corev1.ConfigMap{ + ObjectMeta: metav1.ObjectMeta{ + Name: "grafana-dashboard-openstack-network-traffic", + Namespace: "openshift-config-managed", + Labels: map[string]string{ + "console.openshift.io/dashboard": "true", + }, + }, + Data: map[string]string{ + "openstack-network-traffic.json": ` + { + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "datasource", + "uid": "grafana" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 0, + "id": 1, + "links": [], + "rows": [ + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 18, + "panels": [], + "title": "Overview", + "type": "row" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "type": "prometheus", + "uid": "ce37wzjdfegw0e" + }, + "fieldConfig": { + "defaults": { + "links": [] + }, + "overrides": [] + }, + "fill": 10, + "fillGradient": 0, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 1 + }, + "hiddenSeries": false, + "id": 10, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "10.4.3", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "ce37wzjdfegw0e" + }, + "expr": "vm:ceilometer_network_incoming_bytes:rate1m{project =~ \"$project\", vm_name =~ \"$VM\"}", + "hide": false, + "interval": "", + "legendFormat": "{{vm_name}} in ({{device}})", + "refId": "B" + }, + { + "datasource": { + "type": "prometheus", + "uid": "ce37wzjdfegw0e" + }, + "expr": "vm:ceilometer_network_outgoing_bytes:rate1m{project =~ \"$project\", vm_name =~ \"$VM\"}", + "hide": false, + "interval": "", + "legendFormat": "{{vm_name}} out ({{device}})", + "refId": "A" + } + ], + "thresholds": [], + "timeRegions": [], + "title": "Network Adapter", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "Bps", + "logBase": 1, + "show": true + }, + { + "format": "short", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false + } + }, + { + "collapsed": true, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 9 + }, + "id": 15, + "panels": [ + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "type": "prometheus", + "uid": "ce37wzjdfegw0e" + }, + "fieldConfig": { + "defaults": { + "links": [], + "unit": "p" + }, + "overrides": [] + }, + "fill": 10, + "fillGradient": 0, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 9 + }, + "hiddenSeries": false, + "id": 6, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "10.4.3", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "ce37wzjdfegw0e" + }, + "editorMode": "code", + "expr": "vm:ceilometer_network_incoming_bytes:rate1m{resource_name=~\"$VM:$In_adapter\", project=~\"$project\" } / 1000000", + "hide": false, + "interval": "", + "legendFormat": "__auto", + "range": true, + "refId": "A" + } + ], + "thresholds": [], + "timeRegions": [], + "title": "Network Incoming Packets", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "show": true, + "values": [] + }, + "yaxes": [ + { + "$$hashKey": "object:892", + "format": "p", + "logBase": 1, + "show": true + }, + { + "$$hashKey": "object:893", + "format": "short", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false + } + }, + { + "datasource": { + "type": "prometheus", + "uid": "ce37wzjdfegw0e" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisGridShow": true, + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 100, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + } + ] + }, + "unit": "p" + }, + "overrides": [ + { + "__systemRef": "hideSeriesFrom", + "matcher": { + "id": "byNames", + "options": { + "mode": "exclude", + "names": [ + "{__name__=\"vm:ceilometer_network_incoming_packets_drop:rate1m\", counter=\"network.incoming.packets.drop\", device=\"tap0cb7726a-da\", instance=\"ceilometer-internal.openstack.svc:3000\", network=\"packets\", project=\"539c3dc2361f4fd191aaa21c14360e35\", resource=\"instance-00000002-618ba30a-64d4-4795-9f6e-b85192d9305e-tap0cb7726a-da\", resource_name=\"vm1:tap0cb7726a-da\", unit=\"packet\", user=\"da73d63ddab141ab9fefbe03881fb6cd\", vm_instance=\"ee80218bf7db3248e7dd153f3340014d116f7af438ddeb08420677e9\", vm_name=\"vm1\"}" + ], + "prefix": "All except:", + "readOnly": true + } + }, + "properties": [ + { + "id": "custom.hideFrom", + "value": { + "legend": false, + "tooltip": false, + "viz": true + } + } + ] + } + ] + }, + "gridPos": { + "h": 9, + "w": 12, + "x": 12, + "y": 9 + }, + "id": 2, + "options": { + "legend": { + "calcs": [], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "timezone": [ + "" + ], + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "10.4.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "ce37wzjdfegw0e" + }, + "editorMode": "code", + "expr": "vm:ceilometer_network_incoming_packets_drop:rate1m{project =~ \"$project\",vm_name =~ \"$VM\", device =~\"$In_adapter\" }", + "hide": false, + "interval": "", + "legendFormat": "__auto", + "range": true, + "refId": "A" + } + ], + "title": "Incoming Dropped Packets", + "type": "timeseries" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "type": "prometheus", + "uid": "ce37wzjdfegw0e" + }, + "fieldConfig": { + "defaults": { + "links": [], + "unit": "percentunit" + }, + "overrides": [] + }, + "fill": 10, + "fillGradient": 0, + "gridPos": { + "h": 9, + "w": 12, + "x": 0, + "y": 17 + }, + "hiddenSeries": false, + "id": 12, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "10.4.3", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "ce37wzjdfegw0e" + }, + "editorMode": "code", + "expr": "(rate(ceilometer_network_incoming_packets_drop{project=~\"$project\", resource_name=~\"$VM:$In_adapter\"}[1m]) / rate(ceilometer_network_incoming_packets{project=~\"$project\", resource_name=~\"$VM:In_adapter\"}[1m])) * 100\n", + "hide": false, + "interval": "", + "legendFormat": "__auto", + "range": true, + "refId": "A" + } + ], + "thresholds": [ + { + "$$hashKey": "object:151", + "colorMode": "critical", + "fill": true, + "line": true, + "op": "gt", + "value": 30, + "yaxis": "left" + } + ], + "timeRegions": [], + "title": "Incoming Packet Loss (%)", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "show": true, + "values": [] + }, + "yaxes": [ + { + "$$hashKey": "object:946", + "format": "percentunit", + "logBase": 1, + "show": true + }, + { + "$$hashKey": "object:947", + "format": "short", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false + } + }, + { + "datasource": { + "type": "prometheus", + "uid": "ce37wzjdfegw0e" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisGridShow": true, + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 100, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + } + ] + }, + "unit": "p" + }, + "overrides": [ + { + "__systemRef": "hideSeriesFrom", + "matcher": { + "id": "byNames", + "options": { + "mode": "exclude", + "names": [ + "{__name__=\"vm:ceilometer_network_incoming_packets_error:rate1m\", counter=\"network.incoming.packets.error\", device=\"tap0cb7726a-da\", instance=\"ceilometer-internal.openstack.svc:3000\", network=\"packets\", project=\"539c3dc2361f4fd191aaa21c14360e35\", resource=\"instance-00000002-618ba30a-64d4-4795-9f6e-b85192d9305e-tap0cb7726a-da\", resource_name=\"vm1:tap0cb7726a-da\", unit=\"packet\", user=\"da73d63ddab141ab9fefbe03881fb6cd\", vm_instance=\"ee80218bf7db3248e7dd153f3340014d116f7af438ddeb08420677e9\", vm_name=\"vm1\"}" + ], + "prefix": "All except:", + "readOnly": true + } + }, + "properties": [ + { + "id": "custom.hideFrom", + "value": { + "legend": false, + "tooltip": false, + "viz": true + } + } + ] + } + ] + }, + "gridPos": { + "h": 9, + "w": 12, + "x": 12, + "y": 18 + }, + "id": 16, + "options": { + "legend": { + "calcs": [], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "timezone": [ + "" + ], + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "10.4.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "ce37wzjdfegw0e" + }, + "editorMode": "code", + "expr": "vm:ceilometer_network_incoming_packets_error:rate1m{project =~ \"$project\",vm_name =~ \"$VM\", device =~\"$In_adapter\"}", + "hide": false, + "interval": "", + "legendFormat": "__auto", + "range": true, + "refId": "A" + } + ], + "title": "Incoming Packets Error", + "type": "timeseries" + } + ], + "title": "Inbound Traffic", + "type": "row" + }, + { + "collapsed": true, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 10 + }, + "id": 14, + "panels": [ + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "type": "prometheus", + "uid": "ce37wzjdfegw0e" + }, + "fieldConfig": { + "defaults": { + "links": [], + "unit": "p" + }, + "overrides": [] + }, + "fill": 10, + "fillGradient": 0, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 11 + }, + "hiddenSeries": false, + "id": 11, + "legend": { + "alignAsTable": true, + "avg": false, + "current": false, + "max": false, + "min": false, + "rightSide": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "10.4.3", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "ce37wzjdfegw0e" + }, + "editorMode": "code", + "expr": "vm:ceilometer_network_outgoing_bytes:rate1m{resource_name=~\"$VM:$out_adapter\", project=~\"$project\"} / 1000000", + "hide": false, + "interval": "", + "legendFormat": "__auto", + "range": true, + "refId": "A" + } + ], + "thresholds": [], + "timeRegions": [], + "title": "Network Outgoing Packets", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "show": true, + "values": [] + }, + "yaxes": [ + { + "$$hashKey": "object:1127", + "format": "p", + "logBase": 1, + "show": true + }, + { + "$$hashKey": "object:1128", + "format": "short", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "type": "prometheus", + "uid": "ce37wzjdfegw0e" + }, + "fieldConfig": { + "defaults": { + "links": [], + "unit": "p" + }, + "overrides": [] + }, + "fill": 10, + "fillGradient": 0, + "gridPos": { + "h": 9, + "w": 12, + "x": 12, + "y": 11 + }, + "hiddenSeries": false, + "id": 4, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "10.4.3", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "ce37wzjdfegw0e" + }, + "editorMode": "code", + "expr": "vm:ceilometer_network_outgoing_packets_drop:rate1m{project =~ \"$project\", vm_name =~ \"$VM\", device=~\"$out_adapter\"}", + "hide": false, + "interval": "", + "legendFormat": "__auto", + "range": true, + "refId": "A" + } + ], + "thresholds": [], + "timeRegions": [], + "title": "Outgoing Dropped Packets", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "show": true, + "values": [] + }, + "yaxes": [ + { + "$$hashKey": "object:764", + "format": "p", + "logBase": 1, + "show": true + }, + { + "$$hashKey": "object:765", + "format": "short", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "type": "prometheus", + "uid": "ce37wzjdfegw0e" + }, + "fieldConfig": { + "defaults": { + "links": [], + "unit": "percentunit" + }, + "overrides": [] + }, + "fill": 10, + "fillGradient": 0, + "gridPos": { + "h": 9, + "w": 12, + "x": 0, + "y": 19 + }, + "hiddenSeries": false, + "id": 13, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "10.4.3", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "ce37wzjdfegw0e" + }, + "editorMode": "code", + "expr": "(rate(ceilometer_network_outgoing_packets_drop{project=~\"$project\", resource_name=~\"$VM:$out_adapter\"}[1m]) / rate(ceilometer_network_outgoing_packets{project=~\"$project\", resource_name=~\"$VM:$out_adapter\"}[1m])) * 100\n", + "hide": false, + "interval": "", + "legendFormat": "__auto", + "range": true, + "refId": "A" + } + ], + "thresholds": [ + { + "$$hashKey": "object:216", + "colorMode": "critical", + "fill": true, + "line": true, + "op": "gt", + "value": 80, + "yaxis": "left" + } + ], + "timeRegions": [], + "title": "Ountgoing Packet Loss (%)", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "show": true, + "values": [] + }, + "yaxes": [ + { + "$$hashKey": "object:1253", + "format": "percentunit", + "logBase": 1, + "show": true + }, + { + "$$hashKey": "object:1254", + "format": "short", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "type": "prometheus", + "uid": "ce37wzjdfegw0e" + }, + "fieldConfig": { + "defaults": { + "links": [], + "unit": "p" + }, + "overrides": [] + }, + "fill": 10, + "fillGradient": 0, + "gridPos": { + "h": 9, + "w": 12, + "x": 12, + "y": 20 + }, + "hiddenSeries": false, + "id": 17, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "10.4.3", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "ce37wzjdfegw0e" + }, + "editorMode": "code", + "expr": "vm:ceilometer_network_outgoing_packets_error:rate1m{project =~ \"$project\", vm_name =~ \"$VM\", device=~\"$out_adapter\"}", + "hide": false, + "interval": "", + "legendFormat": "__auto", + "range": true, + "refId": "A" + } + ], + "thresholds": [], + "timeRegions": [], + "title": "Outgoing Packets Error", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "show": true, + "values": [] + }, + "yaxes": [ + { + "$$hashKey": "object:764", + "format": "p", + "logBase": 1, + "show": true + }, + { + "$$hashKey": "object:765", + "format": "short", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false + } + } + ], + "title": "Outbound Traffic", + "type": "row" + } + ], + "refresh": "10s", + "schemaVersion": 39, + "tags": [ + "openstack-telemetry-operator" + ], + "templating": { + "list": [ + { + "allValue": ".*", + "current": { + "selected": false, + "text": "ee80218bf7db3248e7dd153f3340014d116f7af438ddeb08420677e9", + "value": "ee80218bf7db3248e7dd153f3340014d116f7af438ddeb08420677e9" + }, + "datasource": { + "type": "prometheus", + "uid": "ce37wzjdfegw0e" + }, + "definition": "label_values(vm:ceilometer_network_incoming_bytes:rate1m,vm_instance)", + "hide": 0, + "includeAll": true, + "multi": true, + "name": "compute_node", + "options": [], + "query": { + "qryType": 1, + "query": "label_values(vm:ceilometer_network_incoming_bytes:rate1m,vm_instance)", + "refId": "PrometheusVariableQueryEditor-VariableQuery" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + }, + { + "allValue": ".*", + "current": { + "selected": true, + "text": [ + "All" + ], + "value": [ + "$__all" + ] + }, + "datasource": { + "type": "prometheus", + "uid": "ce37wzjdfegw0e" + }, + "definition": "label_values(ceilometer_cpu{vm_instance=~\"$compute_node\"},project)", + "hide": 0, + "includeAll": true, + "multi": true, + "name": "project", + "options": [], + "query": { + "qryType": 1, + "query": "label_values(ceilometer_cpu{vm_instance=~\"$compute_node\"},project)", + "refId": "PrometheusVariableQueryEditor-VariableQuery" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 1, + "tagValuesQuery": "", + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "allValue": ".*", + "current": { + "selected": true, + "text": [ + "All" + ], + "value": [ + "$__all" + ] + }, + "datasource": { + "type": "prometheus", + "uid": "ce37wzjdfegw0e" + }, + "definition": "label_values(ceilometer_cpu{project =~ \"$project\"}, vm_instance)", + "hide": 0, + "includeAll": true, + "multi": true, + "name": "VM", + "options": [], + "query": "label_values(vm:ceilometer_cpu:ratio1m{project =~ \"$project\"}, vm_name)", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "tagValuesQuery": "", + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "allValue": ".*", + "current": { + "selected": true, + "text": [ + "All" + ], + "value": [ + "$__all" + ] + }, + "datasource": { + "type": "prometheus", + "uid": "ce37wzjdfegw0e" + }, + "definition": "label_values(vm:ceilometer_network_incoming_bytes:rate1m{vm_name=~\"$VM\"},device)", + "hide": 0, + "includeAll": true, + "multi": true, + "name": "In_adapter", + "options": [], + "query": { + "qryType": 1, + "query": "label_values(vm:ceilometer_network_incoming_bytes:rate1m{vm_name=~\"$VM\"},device)", + "refId": "PrometheusVariableQueryEditor-VariableQuery" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + }, + { + "allValue": ".*", + "current": { + "selected": false, + "text": "tap0cb7726a-da", + "value": "tap0cb7726a-da" + }, + "datasource": { + "type": "prometheus", + "uid": "ce37wzjdfegw0e" + }, + "definition": "label_values(vm:ceilometer_network_outgoing_bytes:rate1m{vm_name=~\"$VM\"},device)", + "hide": 0, + "includeAll": true, + "multi": true, + "name": "out_adapter", + "options": [], + "query": { + "qryType": 1, + "query": "label_values(vm:ceilometer_network_outgoing_bytes:rate1m{vm_name=~\"$VM\"},device)", + "refId": "PrometheusVariableQueryEditor-VariableQuery" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + } + ] + }, + "time": { + "from": "now-6h", + "to": "now" + }, + "timepicker": { + "refresh_intervals": [ + "5s", + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ] + }, + "timezone": "", + "title": "OpenStack / VMs Network Traffic", + "version": 36, + "weekStart": "" + }`, + }, + } + + return dashboardCM +} \ No newline at end of file diff --git a/pkg/metricstorage/dashboard_objects.go b/pkg/metricstorage/dashboard_objects.go index bca30d94..051a78fd 100644 --- a/pkg/metricstorage/dashboard_objects.go +++ b/pkg/metricstorage/dashboard_objects.go @@ -59,6 +59,7 @@ func DeleteDashboardObjects(ctx context.Context, instance *telemetryv1.MetricSto "grafana-dashboard-openstack-vm", "grafana-dashboard-openstack-rabbitmq", "grafana-dashboard-openstack-kepler", + "grafana-dashboard-openstack-network-traffic", } for _, name := range dashboards { dashboardCM := &corev1.ConfigMap{ diff --git a/tests/kuttl/suites/metricstorage/tests/01-assert.yaml b/tests/kuttl/suites/metricstorage/tests/01-assert.yaml index 955d50b5..641f412a 100644 --- a/tests/kuttl/suites/metricstorage/tests/01-assert.yaml +++ b/tests/kuttl/suites/metricstorage/tests/01-assert.yaml @@ -146,3 +146,9 @@ kind: ConfigMap metadata: name: grafana-dashboard-openstack-rabbitmq namespace: openshift-config-managed +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: grafana-dashboard-openstack-network-traffic + namespace: openshift-config-managed \ No newline at end of file diff --git a/tests/kuttl/suites/metricstorage/tests/02-errors.yaml b/tests/kuttl/suites/metricstorage/tests/02-errors.yaml index 8c0f82f6..051cee27 100644 --- a/tests/kuttl/suites/metricstorage/tests/02-errors.yaml +++ b/tests/kuttl/suites/metricstorage/tests/02-errors.yaml @@ -36,3 +36,9 @@ kind: ConfigMap metadata: name: grafana-dashboard-openstack-rabbitmq namespace: openshift-config-managed +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: grafana-dashboard-openstack-network-traffic + namespace: openshift-config-managed \ No newline at end of file From 22bedea0e00df343992898dadfbfe3e994210856 Mon Sep 17 00:00:00 2001 From: mgirgisf Date: Mon, 9 Dec 2024 11:45:36 +0100 Subject: [PATCH 2/8] solev pre-commit --- controllers/metricstorage_controller.go | 10 +++++----- pkg/dashboards/openstack-network-traffic.go | 2 +- tests/kuttl/suites/metricstorage/tests/01-assert.yaml | 2 +- tests/kuttl/suites/metricstorage/tests/02-errors.yaml | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/controllers/metricstorage_controller.go b/controllers/metricstorage_controller.go index 16f3fbdb..4442e5ab 100644 --- a/controllers/metricstorage_controller.go +++ b/controllers/metricstorage_controller.go @@ -773,11 +773,11 @@ func (r *MetricStorageReconciler) createDashboardObjects(ctx context.Context, in // NOTE: Dashboards installed without the custom datasource will default to the openshift-monitoring prometheus causing unexpected results if dataSourceSuccess { dashboardCMs := map[string]*corev1.ConfigMap{ - "grafana-dashboard-openstack-cloud": dashboards.OpenstackCloud(datasourceName), - "grafana-dashboard-openstack-node": dashboards.OpenstackNode(datasourceName), - "grafana-dashboard-openstack-vm": dashboards.OpenstackVM(datasourceName), - "grafana-dashboard-openstack-rabbitmq": dashboards.OpenstackRabbitmq(datasourceName), - "grafana-dashboard-openstack-network-traffic": dashboards.OpenstackNetworkTraffic(datasourceName), + "grafana-dashboard-openstack-cloud": dashboards.OpenstackCloud(datasourceName), + "grafana-dashboard-openstack-node": dashboards.OpenstackNode(datasourceName), + "grafana-dashboard-openstack-vm": dashboards.OpenstackVM(datasourceName), + "grafana-dashboard-openstack-rabbitmq": dashboards.OpenstackRabbitmq(datasourceName), + "grafana-dashboard-openstack-network-traffic": dashboards.OpenstackNetworkTraffic(datasourceName), } // atleast one nodeset must have "telemetry-power-monitoring" service enabled for kepler dashboard to be created diff --git a/pkg/dashboards/openstack-network-traffic.go b/pkg/dashboards/openstack-network-traffic.go index 91b3a8e4..228282eb 100644 --- a/pkg/dashboards/openstack-network-traffic.go +++ b/pkg/dashboards/openstack-network-traffic.go @@ -1240,4 +1240,4 @@ func OpenstackNetworkTraffic(dsName string) *corev1.ConfigMap { } return dashboardCM -} \ No newline at end of file +} diff --git a/tests/kuttl/suites/metricstorage/tests/01-assert.yaml b/tests/kuttl/suites/metricstorage/tests/01-assert.yaml index 641f412a..203450dc 100644 --- a/tests/kuttl/suites/metricstorage/tests/01-assert.yaml +++ b/tests/kuttl/suites/metricstorage/tests/01-assert.yaml @@ -151,4 +151,4 @@ apiVersion: v1 kind: ConfigMap metadata: name: grafana-dashboard-openstack-network-traffic - namespace: openshift-config-managed \ No newline at end of file + namespace: openshift-config-managed diff --git a/tests/kuttl/suites/metricstorage/tests/02-errors.yaml b/tests/kuttl/suites/metricstorage/tests/02-errors.yaml index 051cee27..236c8394 100644 --- a/tests/kuttl/suites/metricstorage/tests/02-errors.yaml +++ b/tests/kuttl/suites/metricstorage/tests/02-errors.yaml @@ -41,4 +41,4 @@ apiVersion: v1 kind: ConfigMap metadata: name: grafana-dashboard-openstack-network-traffic - namespace: openshift-config-managed \ No newline at end of file + namespace: openshift-config-managed From c0dbf68fd8c96f20af2a0e9aa4de1ddc3c80349a Mon Sep 17 00:00:00 2001 From: mgirgisf Date: Tue, 10 Dec 2024 12:59:29 +0100 Subject: [PATCH 3/8] Update datasource --- pkg/dashboards/openstack-network-traffic.go | 110 ++++---------------- 1 file changed, 22 insertions(+), 88 deletions(-) diff --git a/pkg/dashboards/openstack-network-traffic.go b/pkg/dashboards/openstack-network-traffic.go index 228282eb..b483c31c 100644 --- a/pkg/dashboards/openstack-network-traffic.go +++ b/pkg/dashboards/openstack-network-traffic.go @@ -73,10 +73,7 @@ func OpenstackNetworkTraffic(dsName string) *corev1.ConfigMap { "bars": false, "dashLength": 10, "dashes": false, - "datasource": { - "type": "prometheus", - "uid": "ce37wzjdfegw0e" - }, + "datasource": { "name": "` + dsName + `", "type": "prometheus" }, "fieldConfig": { "defaults": { "links": [] @@ -119,10 +116,7 @@ func OpenstackNetworkTraffic(dsName string) *corev1.ConfigMap { "steppedLine": false, "targets": [ { - "datasource": { - "type": "prometheus", - "uid": "ce37wzjdfegw0e" - }, + "datasource": { "name": "` + dsName + `", "type": "prometheus" }, , "expr": "vm:ceilometer_network_incoming_bytes:rate1m{project =~ \"$project\", vm_name =~ \"$VM\"}", "hide": false, "interval": "", @@ -186,10 +180,7 @@ func OpenstackNetworkTraffic(dsName string) *corev1.ConfigMap { "bars": false, "dashLength": 10, "dashes": false, - "datasource": { - "type": "prometheus", - "uid": "ce37wzjdfegw0e" - }, + "datasource": { "name": "` + dsName + `", "type": "prometheus" }, , "fieldConfig": { "defaults": { "links": [], @@ -233,10 +224,7 @@ func OpenstackNetworkTraffic(dsName string) *corev1.ConfigMap { "steppedLine": false, "targets": [ { - "datasource": { - "type": "prometheus", - "uid": "ce37wzjdfegw0e" - }, + "datasource": { "name": "` + dsName + `", "type": "prometheus" }, , "editorMode": "code", "expr": "vm:ceilometer_network_incoming_bytes:rate1m{resource_name=~\"$VM:$In_adapter\", project=~\"$project\" } / 1000000", "hide": false, @@ -279,10 +267,7 @@ func OpenstackNetworkTraffic(dsName string) *corev1.ConfigMap { } }, { - "datasource": { - "type": "prometheus", - "uid": "ce37wzjdfegw0e" - }, + "datasource": { "name": "` + dsName + `", "type": "prometheus" }, , "fieldConfig": { "defaults": { "color": { @@ -385,10 +370,7 @@ func OpenstackNetworkTraffic(dsName string) *corev1.ConfigMap { "pluginVersion": "10.4.3", "targets": [ { - "datasource": { - "type": "prometheus", - "uid": "ce37wzjdfegw0e" - }, + "datasource": { "name": "` + dsName + `", "type": "prometheus" }, , "editorMode": "code", "expr": "vm:ceilometer_network_incoming_packets_drop:rate1m{project =~ \"$project\",vm_name =~ \"$VM\", device =~\"$In_adapter\" }", "hide": false, @@ -406,10 +388,7 @@ func OpenstackNetworkTraffic(dsName string) *corev1.ConfigMap { "bars": false, "dashLength": 10, "dashes": false, - "datasource": { - "type": "prometheus", - "uid": "ce37wzjdfegw0e" - }, + "datasource": { "name": "` + dsName + `", "type": "prometheus" }, , "fieldConfig": { "defaults": { "links": [], @@ -453,10 +432,7 @@ func OpenstackNetworkTraffic(dsName string) *corev1.ConfigMap { "steppedLine": false, "targets": [ { - "datasource": { - "type": "prometheus", - "uid": "ce37wzjdfegw0e" - }, + "datasource": { "name": "` + dsName + `", "type": "prometheus" }, , "editorMode": "code", "expr": "(rate(ceilometer_network_incoming_packets_drop{project=~\"$project\", resource_name=~\"$VM:$In_adapter\"}[1m]) / rate(ceilometer_network_incoming_packets{project=~\"$project\", resource_name=~\"$VM:In_adapter\"}[1m])) * 100\n", "hide": false, @@ -509,10 +485,7 @@ func OpenstackNetworkTraffic(dsName string) *corev1.ConfigMap { } }, { - "datasource": { - "type": "prometheus", - "uid": "ce37wzjdfegw0e" - }, + "datasource": { "name": "` + dsName + `", "type": "prometheus" }, , "fieldConfig": { "defaults": { "color": { @@ -615,10 +588,7 @@ func OpenstackNetworkTraffic(dsName string) *corev1.ConfigMap { "pluginVersion": "10.4.3", "targets": [ { - "datasource": { - "type": "prometheus", - "uid": "ce37wzjdfegw0e" - }, + "datasource": { "name": "` + dsName + `", "type": "prometheus" }, , "editorMode": "code", "expr": "vm:ceilometer_network_incoming_packets_error:rate1m{project =~ \"$project\",vm_name =~ \"$VM\", device =~\"$In_adapter\"}", "hide": false, @@ -699,10 +669,7 @@ func OpenstackNetworkTraffic(dsName string) *corev1.ConfigMap { "steppedLine": false, "targets": [ { - "datasource": { - "type": "prometheus", - "uid": "ce37wzjdfegw0e" - }, + "datasource": { "name": "` + dsName + `", "type": "prometheus" }, , "editorMode": "code", "expr": "vm:ceilometer_network_outgoing_bytes:rate1m{resource_name=~\"$VM:$out_adapter\", project=~\"$project\"} / 1000000", "hide": false, @@ -749,10 +716,7 @@ func OpenstackNetworkTraffic(dsName string) *corev1.ConfigMap { "bars": false, "dashLength": 10, "dashes": false, - "datasource": { - "type": "prometheus", - "uid": "ce37wzjdfegw0e" - }, + "datasource": { "name": "` + dsName + `", "type": "prometheus" }, , "fieldConfig": { "defaults": { "links": [], @@ -796,10 +760,7 @@ func OpenstackNetworkTraffic(dsName string) *corev1.ConfigMap { "steppedLine": false, "targets": [ { - "datasource": { - "type": "prometheus", - "uid": "ce37wzjdfegw0e" - }, + "datasource": { "name": "` + dsName + `", "type": "prometheus" }, , "editorMode": "code", "expr": "vm:ceilometer_network_outgoing_packets_drop:rate1m{project =~ \"$project\", vm_name =~ \"$VM\", device=~\"$out_adapter\"}", "hide": false, @@ -846,10 +807,7 @@ func OpenstackNetworkTraffic(dsName string) *corev1.ConfigMap { "bars": false, "dashLength": 10, "dashes": false, - "datasource": { - "type": "prometheus", - "uid": "ce37wzjdfegw0e" - }, + "datasource": { "name": "` + dsName + `", "type": "prometheus" }, , "fieldConfig": { "defaults": { "links": [], @@ -893,10 +851,7 @@ func OpenstackNetworkTraffic(dsName string) *corev1.ConfigMap { "steppedLine": false, "targets": [ { - "datasource": { - "type": "prometheus", - "uid": "ce37wzjdfegw0e" - }, + "datasource": { "name": "` + dsName + `", "type": "prometheus" }, , "editorMode": "code", "expr": "(rate(ceilometer_network_outgoing_packets_drop{project=~\"$project\", resource_name=~\"$VM:$out_adapter\"}[1m]) / rate(ceilometer_network_outgoing_packets{project=~\"$project\", resource_name=~\"$VM:$out_adapter\"}[1m])) * 100\n", "hide": false, @@ -953,10 +908,7 @@ func OpenstackNetworkTraffic(dsName string) *corev1.ConfigMap { "bars": false, "dashLength": 10, "dashes": false, - "datasource": { - "type": "prometheus", - "uid": "ce37wzjdfegw0e" - }, + "datasource": { "name": "` + dsName + `", "type": "prometheus" }, , "fieldConfig": { "defaults": { "links": [], @@ -1000,10 +952,7 @@ func OpenstackNetworkTraffic(dsName string) *corev1.ConfigMap { "steppedLine": false, "targets": [ { - "datasource": { - "type": "prometheus", - "uid": "ce37wzjdfegw0e" - }, + "datasource": { "name": "` + dsName + `", "type": "prometheus" }, , "editorMode": "code", "expr": "vm:ceilometer_network_outgoing_packets_error:rate1m{project =~ \"$project\", vm_name =~ \"$VM\", device=~\"$out_adapter\"}", "hide": false, @@ -1064,10 +1013,7 @@ func OpenstackNetworkTraffic(dsName string) *corev1.ConfigMap { "text": "ee80218bf7db3248e7dd153f3340014d116f7af438ddeb08420677e9", "value": "ee80218bf7db3248e7dd153f3340014d116f7af438ddeb08420677e9" }, - "datasource": { - "type": "prometheus", - "uid": "ce37wzjdfegw0e" - }, + "datasource": { "name": "` + dsName + `", "type": "prometheus" }, , "definition": "label_values(vm:ceilometer_network_incoming_bytes:rate1m,vm_instance)", "hide": 0, "includeAll": true, @@ -1096,10 +1042,7 @@ func OpenstackNetworkTraffic(dsName string) *corev1.ConfigMap { "$__all" ] }, - "datasource": { - "type": "prometheus", - "uid": "ce37wzjdfegw0e" - }, + "datasource":{ "name": "` + dsName + `", "type": "prometheus" }, , "definition": "label_values(ceilometer_cpu{vm_instance=~\"$compute_node\"},project)", "hide": 0, "includeAll": true, @@ -1131,10 +1074,7 @@ func OpenstackNetworkTraffic(dsName string) *corev1.ConfigMap { "$__all" ] }, - "datasource": { - "type": "prometheus", - "uid": "ce37wzjdfegw0e" - }, + "datasource": { "name": "` + dsName + `", "type": "prometheus" }, , "definition": "label_values(ceilometer_cpu{project =~ \"$project\"}, vm_instance)", "hide": 0, "includeAll": true, @@ -1162,10 +1102,7 @@ func OpenstackNetworkTraffic(dsName string) *corev1.ConfigMap { "$__all" ] }, - "datasource": { - "type": "prometheus", - "uid": "ce37wzjdfegw0e" - }, + "datasource": { "name": "` + dsName + `", "type": "prometheus" }, , "definition": "label_values(vm:ceilometer_network_incoming_bytes:rate1m{vm_name=~\"$VM\"},device)", "hide": 0, "includeAll": true, @@ -1190,10 +1127,7 @@ func OpenstackNetworkTraffic(dsName string) *corev1.ConfigMap { "text": "tap0cb7726a-da", "value": "tap0cb7726a-da" }, - "datasource": { - "type": "prometheus", - "uid": "ce37wzjdfegw0e" - }, + "datasource": { "name": "` + dsName + `", "type": "prometheus" }, , "definition": "label_values(vm:ceilometer_network_outgoing_bytes:rate1m{vm_name=~\"$VM\"},device)", "hide": 0, "includeAll": true, From dd921dcb92481e9206f61a06310cb54573a103ae Mon Sep 17 00:00:00 2001 From: mgirgisf Date: Wed, 11 Dec 2024 11:40:11 +0100 Subject: [PATCH 4/8] Update datasource --- pkg/dashboards/openstack-network-traffic.go | 316 ++++++++++---------- 1 file changed, 157 insertions(+), 159 deletions(-) diff --git a/pkg/dashboards/openstack-network-traffic.go b/pkg/dashboards/openstack-network-traffic.go index b483c31c..5d809f87 100644 --- a/pkg/dashboards/openstack-network-traffic.go +++ b/pkg/dashboards/openstack-network-traffic.go @@ -37,10 +37,7 @@ func OpenstackNetworkTraffic(dsName string) *corev1.ConfigMap { "list": [ { "builtIn": 1, - "datasource": { - "type": "datasource", - "uid": "grafana" - }, + "datasource": "-- Grafana --", "enable": true, "hide": true, "iconColor": "rgba(0, 211, 255, 1)", @@ -50,137 +47,135 @@ func OpenstackNetworkTraffic(dsName string) *corev1.ConfigMap { ] }, "editable": true, - "fiscalYearStartMonth": 0, "graphTooltip": 0, "id": 1, "links": [], "rows": [ { + "collapse": false, "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 0 - }, - "id": 18, - "panels": [], + "repeat": null, + "repeatIteration": null, + "repeatRowId": null, + "showTitle": true, "title": "Overview", - "type": "row" - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": { "name": "` + dsName + `", "type": "prometheus" }, - "fieldConfig": { - "defaults": { - "links": [] - }, - "overrides": [] - }, - "fill": 10, - "fillGradient": 0, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 1 - }, - "hiddenSeries": false, - "id": 10, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", - "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "10.4.3", - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "datasource": { "name": "` + dsName + `", "type": "prometheus" }, , - "expr": "vm:ceilometer_network_incoming_bytes:rate1m{project =~ \"$project\", vm_name =~ \"$VM\"}", - "hide": false, - "interval": "", - "legendFormat": "{{vm_name}} in ({{device}})", - "refId": "B" - }, - { - "datasource": { - "type": "prometheus", - "uid": "ce37wzjdfegw0e" - }, - "expr": "vm:ceilometer_network_outgoing_bytes:rate1m{project =~ \"$project\", vm_name =~ \"$VM\"}", - "hide": false, - "interval": "", - "legendFormat": "{{vm_name}} out ({{device}})", - "refId": "A" - } - ], - "thresholds": [], - "timeRegions": [], - "title": "Network Adapter", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "Bps", - "logBase": 1, - "show": true - }, - { - "format": "short", - "logBase": 1, - "show": true - } - ], - "yaxis": { - "align": false - } + "titleSize": "h6", + "type": "row", + "panels": [ + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { "name": "` + dsName + `", "type": "prometheus" }, + "fieldConfig": { + "defaults": { + "links": [] + }, + "overrides": [] + }, + "fill": 10, + "fillGradient": 0, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 1 + }, + "hiddenSeries": false, + "id": 10, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "10.4.3", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "datasource": { "name": "` + dsName + `", "type": "prometheus" }, + "expr": "vm:ceilometer_network_incoming_bytes:rate1m{project =~ \"$project\", vm_name =~ \"$VM\"}", + "hide": false, + "interval": "", + "legendFormat": "{{vm_name}} in ({{device}})", + "refId": "B" + }, + { + "datasource": { "name": "` + dsName + `", "type": "prometheus" }, + "expr": "vm:ceilometer_network_outgoing_bytes:rate1m{project =~ \"$project\", vm_name =~ \"$VM\"}", + "hide": false, + "interval": "", + "legendFormat": "{{vm_name}} out ({{device}})", + "refId": "A" + } + ], + "thresholds": [], + "timeRegions": [], + "title": "Network Adapter", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "Bps", + "logBase": 1, + "show": true + }, + { + "format": "short", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false + } + + } + ] }, { - "collapsed": true, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 9 - }, - "id": 15, + "collapse": false, + "collapsed": false, + "repeat": null, + "repeatIteration": null, + "repeatRowId": null, + "showTitle": true, + "title": "Inbound Traffic", + "titleSize": "h6", + "type": "row", "panels": [ { "aliasColors": {}, "bars": false, "dashLength": 10, "dashes": false, - "datasource": { "name": "` + dsName + `", "type": "prometheus" }, , + "datasource": { "name": "` + dsName + `", "type": "prometheus" }, "fieldConfig": { "defaults": { "links": [], @@ -224,7 +219,7 @@ func OpenstackNetworkTraffic(dsName string) *corev1.ConfigMap { "steppedLine": false, "targets": [ { - "datasource": { "name": "` + dsName + `", "type": "prometheus" }, , + "datasource": { "name": "` + dsName + `", "type": "prometheus" }, "editorMode": "code", "expr": "vm:ceilometer_network_incoming_bytes:rate1m{resource_name=~\"$VM:$In_adapter\", project=~\"$project\" } / 1000000", "hide": false, @@ -266,8 +261,9 @@ func OpenstackNetworkTraffic(dsName string) *corev1.ConfigMap { "align": false } }, + { - "datasource": { "name": "` + dsName + `", "type": "prometheus" }, , + "datasource": { "name": "` + dsName + `", "type": "prometheus" }, "fieldConfig": { "defaults": { "color": { @@ -370,7 +366,7 @@ func OpenstackNetworkTraffic(dsName string) *corev1.ConfigMap { "pluginVersion": "10.4.3", "targets": [ { - "datasource": { "name": "` + dsName + `", "type": "prometheus" }, , + "datasource": { "name": "` + dsName + `", "type": "prometheus" }, "editorMode": "code", "expr": "vm:ceilometer_network_incoming_packets_drop:rate1m{project =~ \"$project\",vm_name =~ \"$VM\", device =~\"$In_adapter\" }", "hide": false, @@ -383,12 +379,16 @@ func OpenstackNetworkTraffic(dsName string) *corev1.ConfigMap { "title": "Incoming Dropped Packets", "type": "timeseries" }, + { "aliasColors": {}, "bars": false, "dashLength": 10, "dashes": false, - "datasource": { "name": "` + dsName + `", "type": "prometheus" }, , + "datasource": { + "type": "prometheus", + "uid": "ce37wzjdfegw0e" + }, "fieldConfig": { "defaults": { "links": [], @@ -432,7 +432,7 @@ func OpenstackNetworkTraffic(dsName string) *corev1.ConfigMap { "steppedLine": false, "targets": [ { - "datasource": { "name": "` + dsName + `", "type": "prometheus" }, , + "datasource": { "name": "` + dsName + `", "type": "prometheus" }, "editorMode": "code", "expr": "(rate(ceilometer_network_incoming_packets_drop{project=~\"$project\", resource_name=~\"$VM:$In_adapter\"}[1m]) / rate(ceilometer_network_incoming_packets{project=~\"$project\", resource_name=~\"$VM:In_adapter\"}[1m])) * 100\n", "hide": false, @@ -484,8 +484,9 @@ func OpenstackNetworkTraffic(dsName string) *corev1.ConfigMap { "align": false } }, + { - "datasource": { "name": "` + dsName + `", "type": "prometheus" }, , + "datasource": { "name": "` + dsName + `", "type": "prometheus" }, "fieldConfig": { "defaults": { "color": { @@ -588,7 +589,7 @@ func OpenstackNetworkTraffic(dsName string) *corev1.ConfigMap { "pluginVersion": "10.4.3", "targets": [ { - "datasource": { "name": "` + dsName + `", "type": "prometheus" }, , + "datasource": { "name": "` + dsName + `", "type": "prometheus" }, "editorMode": "code", "expr": "vm:ceilometer_network_incoming_packets_error:rate1m{project =~ \"$project\",vm_name =~ \"$VM\", device =~\"$In_adapter\"}", "hide": false, @@ -601,29 +602,26 @@ func OpenstackNetworkTraffic(dsName string) *corev1.ConfigMap { "title": "Incoming Packets Error", "type": "timeseries" } - ], - "title": "Inbound Traffic", - "type": "row" + ] }, + { - "collapsed": true, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 10 - }, - "id": 14, + "collapse": false, + "collapsed": false, + "repeat": null, + "repeatIteration": null, + "repeatRowId": null, + "showTitle": true, + "title": "Outbound Traffic", + "titleSize": "h6", + "type": "row", "panels": [ { "aliasColors": {}, "bars": false, "dashLength": 10, "dashes": false, - "datasource": { - "type": "prometheus", - "uid": "ce37wzjdfegw0e" - }, + "datasource": { "name": "` + dsName + `", "type": "prometheus" }, "fieldConfig": { "defaults": { "links": [], @@ -669,7 +667,7 @@ func OpenstackNetworkTraffic(dsName string) *corev1.ConfigMap { "steppedLine": false, "targets": [ { - "datasource": { "name": "` + dsName + `", "type": "prometheus" }, , + "datasource": { "name": "` + dsName + `", "type": "prometheus" }, "editorMode": "code", "expr": "vm:ceilometer_network_outgoing_bytes:rate1m{resource_name=~\"$VM:$out_adapter\", project=~\"$project\"} / 1000000", "hide": false, @@ -716,7 +714,7 @@ func OpenstackNetworkTraffic(dsName string) *corev1.ConfigMap { "bars": false, "dashLength": 10, "dashes": false, - "datasource": { "name": "` + dsName + `", "type": "prometheus" }, , + "datasource": { "name": "` + dsName + `", "type": "prometheus" }, "fieldConfig": { "defaults": { "links": [], @@ -760,7 +758,7 @@ func OpenstackNetworkTraffic(dsName string) *corev1.ConfigMap { "steppedLine": false, "targets": [ { - "datasource": { "name": "` + dsName + `", "type": "prometheus" }, , + "datasource": { "name": "` + dsName + `", "type": "prometheus" }, "editorMode": "code", "expr": "vm:ceilometer_network_outgoing_packets_drop:rate1m{project =~ \"$project\", vm_name =~ \"$VM\", device=~\"$out_adapter\"}", "hide": false, @@ -807,7 +805,7 @@ func OpenstackNetworkTraffic(dsName string) *corev1.ConfigMap { "bars": false, "dashLength": 10, "dashes": false, - "datasource": { "name": "` + dsName + `", "type": "prometheus" }, , + "datasource": { "name": "` + dsName + `", "type": "prometheus" }, "fieldConfig": { "defaults": { "links": [], @@ -851,7 +849,7 @@ func OpenstackNetworkTraffic(dsName string) *corev1.ConfigMap { "steppedLine": false, "targets": [ { - "datasource": { "name": "` + dsName + `", "type": "prometheus" }, , + "datasource": { "name": "` + dsName + `", "type": "prometheus" }, "editorMode": "code", "expr": "(rate(ceilometer_network_outgoing_packets_drop{project=~\"$project\", resource_name=~\"$VM:$out_adapter\"}[1m]) / rate(ceilometer_network_outgoing_packets{project=~\"$project\", resource_name=~\"$VM:$out_adapter\"}[1m])) * 100\n", "hide": false, @@ -908,7 +906,7 @@ func OpenstackNetworkTraffic(dsName string) *corev1.ConfigMap { "bars": false, "dashLength": 10, "dashes": false, - "datasource": { "name": "` + dsName + `", "type": "prometheus" }, , + "datasource": { "name": "` + dsName + `", "type": "prometheus" }, "fieldConfig": { "defaults": { "links": [], @@ -952,7 +950,7 @@ func OpenstackNetworkTraffic(dsName string) *corev1.ConfigMap { "steppedLine": false, "targets": [ { - "datasource": { "name": "` + dsName + `", "type": "prometheus" }, , + "datasource": { "name": "` + dsName + `", "type": "prometheus" }, "editorMode": "code", "expr": "vm:ceilometer_network_outgoing_packets_error:rate1m{project =~ \"$project\", vm_name =~ \"$VM\", device=~\"$out_adapter\"}", "hide": false, @@ -994,11 +992,11 @@ func OpenstackNetworkTraffic(dsName string) *corev1.ConfigMap { "align": false } } - ], - "title": "Outbound Traffic", - "type": "row" + ] } ], + + "refresh": "10s", "schemaVersion": 39, "tags": [ @@ -1010,10 +1008,10 @@ func OpenstackNetworkTraffic(dsName string) *corev1.ConfigMap { "allValue": ".*", "current": { "selected": false, - "text": "ee80218bf7db3248e7dd153f3340014d116f7af438ddeb08420677e9", - "value": "ee80218bf7db3248e7dd153f3340014d116f7af438ddeb08420677e9" + "text": "", + "value": "" }, - "datasource": { "name": "` + dsName + `", "type": "prometheus" }, , + "datasource": { "name": "` + dsName + `", "type": "prometheus" }, "definition": "label_values(vm:ceilometer_network_incoming_bytes:rate1m,vm_instance)", "hide": 0, "includeAll": true, @@ -1042,7 +1040,7 @@ func OpenstackNetworkTraffic(dsName string) *corev1.ConfigMap { "$__all" ] }, - "datasource":{ "name": "` + dsName + `", "type": "prometheus" }, , + "datasource": { "name": "` + dsName + `", "type": "prometheus" }, "definition": "label_values(ceilometer_cpu{vm_instance=~\"$compute_node\"},project)", "hide": 0, "includeAll": true, @@ -1074,7 +1072,7 @@ func OpenstackNetworkTraffic(dsName string) *corev1.ConfigMap { "$__all" ] }, - "datasource": { "name": "` + dsName + `", "type": "prometheus" }, , + "datasource": { "name": "` + dsName + `", "type": "prometheus" }, "definition": "label_values(ceilometer_cpu{project =~ \"$project\"}, vm_instance)", "hide": 0, "includeAll": true, @@ -1102,7 +1100,7 @@ func OpenstackNetworkTraffic(dsName string) *corev1.ConfigMap { "$__all" ] }, - "datasource": { "name": "` + dsName + `", "type": "prometheus" }, , + "datasource": { "name": "` + dsName + `", "type": "prometheus" }, "definition": "label_values(vm:ceilometer_network_incoming_bytes:rate1m{vm_name=~\"$VM\"},device)", "hide": 0, "includeAll": true, @@ -1127,7 +1125,7 @@ func OpenstackNetworkTraffic(dsName string) *corev1.ConfigMap { "text": "tap0cb7726a-da", "value": "tap0cb7726a-da" }, - "datasource": { "name": "` + dsName + `", "type": "prometheus" }, , + "datasource": { "name": "` + dsName + `", "type": "prometheus" }, "definition": "label_values(vm:ceilometer_network_outgoing_bytes:rate1m{vm_name=~\"$VM\"},device)", "hide": 0, "includeAll": true, From 27b3ff18663b3707bb960197bf88c8f095a1f40a Mon Sep 17 00:00:00 2001 From: mgirgisf Date: Thu, 12 Dec 2024 12:35:06 +0100 Subject: [PATCH 5/8] Update Json --- pkg/dashboards/openstack-network-traffic.go | 2281 ++++++++++--------- 1 file changed, 1144 insertions(+), 1137 deletions(-) diff --git a/pkg/dashboards/openstack-network-traffic.go b/pkg/dashboards/openstack-network-traffic.go index 5d809f87..9c99e128 100644 --- a/pkg/dashboards/openstack-network-traffic.go +++ b/pkg/dashboards/openstack-network-traffic.go @@ -32,1144 +32,1151 @@ func OpenstackNetworkTraffic(dsName string) *corev1.ConfigMap { }, Data: map[string]string{ "openstack-network-traffic.json": ` - { - "annotations": { - "list": [ - { - "builtIn": 1, - "datasource": "-- Grafana --", - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations & Alerts", - "type": "dashboard" - } - ] - }, - "editable": true, - "graphTooltip": 0, - "id": 1, - "links": [], - "rows": [ - { - "collapse": false, - "collapsed": false, - "repeat": null, - "repeatIteration": null, - "repeatRowId": null, - "showTitle": true, - "title": "Overview", - "titleSize": "h6", - "type": "row", - "panels": [ - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": { "name": "` + dsName + `", "type": "prometheus" }, - "fieldConfig": { - "defaults": { - "links": [] - }, - "overrides": [] - }, - "fill": 10, - "fillGradient": 0, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 1 - }, - "hiddenSeries": false, - "id": 10, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", - "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "10.4.3", - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "datasource": { "name": "` + dsName + `", "type": "prometheus" }, - "expr": "vm:ceilometer_network_incoming_bytes:rate1m{project =~ \"$project\", vm_name =~ \"$VM\"}", - "hide": false, - "interval": "", - "legendFormat": "{{vm_name}} in ({{device}})", - "refId": "B" - }, - { - "datasource": { "name": "` + dsName + `", "type": "prometheus" }, - "expr": "vm:ceilometer_network_outgoing_bytes:rate1m{project =~ \"$project\", vm_name =~ \"$VM\"}", - "hide": false, - "interval": "", - "legendFormat": "{{vm_name}} out ({{device}})", - "refId": "A" - } - ], - "thresholds": [], - "timeRegions": [], - "title": "Network Adapter", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "Bps", - "logBase": 1, - "show": true - }, - { - "format": "short", - "logBase": 1, - "show": true - } - ], - "yaxis": { - "align": false - } - - } - ] - }, - { - "collapse": false, - "collapsed": false, - "repeat": null, - "repeatIteration": null, - "repeatRowId": null, - "showTitle": true, - "title": "Inbound Traffic", - "titleSize": "h6", - "type": "row", - "panels": [ - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": { "name": "` + dsName + `", "type": "prometheus" }, - "fieldConfig": { - "defaults": { - "links": [], - "unit": "p" - }, - "overrides": [] - }, - "fill": 10, - "fillGradient": 0, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 9 - }, - "hiddenSeries": false, - "id": 6, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", - "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "10.4.3", - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "datasource": { "name": "` + dsName + `", "type": "prometheus" }, - "editorMode": "code", - "expr": "vm:ceilometer_network_incoming_bytes:rate1m{resource_name=~\"$VM:$In_adapter\", project=~\"$project\" } / 1000000", - "hide": false, - "interval": "", - "legendFormat": "__auto", - "range": true, - "refId": "A" - } - ], - "thresholds": [], - "timeRegions": [], - "title": "Network Incoming Packets", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "$$hashKey": "object:892", - "format": "p", - "logBase": 1, - "show": true - }, - { - "$$hashKey": "object:893", - "format": "short", - "logBase": 1, - "show": true - } - ], - "yaxis": { - "align": false - } - }, - - { - "datasource": { "name": "` + dsName + `", "type": "prometheus" }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisGridShow": true, - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 100, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "never", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "p" - }, - "overrides": [ - { - "__systemRef": "hideSeriesFrom", - "matcher": { - "id": "byNames", - "options": { - "mode": "exclude", - "names": [ - "{__name__=\"vm:ceilometer_network_incoming_packets_drop:rate1m\", counter=\"network.incoming.packets.drop\", device=\"tap0cb7726a-da\", instance=\"ceilometer-internal.openstack.svc:3000\", network=\"packets\", project=\"539c3dc2361f4fd191aaa21c14360e35\", resource=\"instance-00000002-618ba30a-64d4-4795-9f6e-b85192d9305e-tap0cb7726a-da\", resource_name=\"vm1:tap0cb7726a-da\", unit=\"packet\", user=\"da73d63ddab141ab9fefbe03881fb6cd\", vm_instance=\"ee80218bf7db3248e7dd153f3340014d116f7af438ddeb08420677e9\", vm_name=\"vm1\"}" - ], - "prefix": "All except:", - "readOnly": true - } - }, - "properties": [ - { - "id": "custom.hideFrom", - "value": { - "legend": false, - "tooltip": false, - "viz": true - } - } - ] - } - ] - }, - "gridPos": { - "h": 9, - "w": 12, - "x": 12, - "y": 9 - }, - "id": 2, - "options": { - "legend": { - "calcs": [], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "timezone": [ - "" - ], - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.4.3", - "targets": [ - { - "datasource": { "name": "` + dsName + `", "type": "prometheus" }, - "editorMode": "code", - "expr": "vm:ceilometer_network_incoming_packets_drop:rate1m{project =~ \"$project\",vm_name =~ \"$VM\", device =~\"$In_adapter\" }", - "hide": false, - "interval": "", - "legendFormat": "__auto", - "range": true, - "refId": "A" - } - ], - "title": "Incoming Dropped Packets", - "type": "timeseries" - }, - - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": { - "type": "prometheus", - "uid": "ce37wzjdfegw0e" - }, - "fieldConfig": { - "defaults": { - "links": [], - "unit": "percentunit" - }, - "overrides": [] - }, - "fill": 10, - "fillGradient": 0, - "gridPos": { - "h": 9, - "w": 12, - "x": 0, - "y": 17 - }, - "hiddenSeries": false, - "id": 12, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", - "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "10.4.3", - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "datasource": { "name": "` + dsName + `", "type": "prometheus" }, - "editorMode": "code", - "expr": "(rate(ceilometer_network_incoming_packets_drop{project=~\"$project\", resource_name=~\"$VM:$In_adapter\"}[1m]) / rate(ceilometer_network_incoming_packets{project=~\"$project\", resource_name=~\"$VM:In_adapter\"}[1m])) * 100\n", - "hide": false, - "interval": "", - "legendFormat": "__auto", - "range": true, - "refId": "A" - } - ], - "thresholds": [ - { - "$$hashKey": "object:151", - "colorMode": "critical", - "fill": true, - "line": true, - "op": "gt", - "value": 30, - "yaxis": "left" - } - ], - "timeRegions": [], - "title": "Incoming Packet Loss (%)", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "$$hashKey": "object:946", - "format": "percentunit", - "logBase": 1, - "show": true - }, - { - "$$hashKey": "object:947", - "format": "short", - "logBase": 1, - "show": true - } - ], - "yaxis": { - "align": false - } - }, - - { - "datasource": { "name": "` + dsName + `", "type": "prometheus" }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisGridShow": true, - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 100, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "never", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - } - ] - }, - "unit": "p" - }, - "overrides": [ - { - "__systemRef": "hideSeriesFrom", - "matcher": { - "id": "byNames", - "options": { - "mode": "exclude", - "names": [ - "{__name__=\"vm:ceilometer_network_incoming_packets_error:rate1m\", counter=\"network.incoming.packets.error\", device=\"tap0cb7726a-da\", instance=\"ceilometer-internal.openstack.svc:3000\", network=\"packets\", project=\"539c3dc2361f4fd191aaa21c14360e35\", resource=\"instance-00000002-618ba30a-64d4-4795-9f6e-b85192d9305e-tap0cb7726a-da\", resource_name=\"vm1:tap0cb7726a-da\", unit=\"packet\", user=\"da73d63ddab141ab9fefbe03881fb6cd\", vm_instance=\"ee80218bf7db3248e7dd153f3340014d116f7af438ddeb08420677e9\", vm_name=\"vm1\"}" - ], - "prefix": "All except:", - "readOnly": true - } - }, - "properties": [ - { - "id": "custom.hideFrom", - "value": { - "legend": false, - "tooltip": false, - "viz": true - } - } - ] - } - ] - }, - "gridPos": { - "h": 9, - "w": 12, - "x": 12, - "y": 18 - }, - "id": 16, - "options": { - "legend": { - "calcs": [], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "timezone": [ - "" - ], - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.4.3", - "targets": [ - { - "datasource": { "name": "` + dsName + `", "type": "prometheus" }, - "editorMode": "code", - "expr": "vm:ceilometer_network_incoming_packets_error:rate1m{project =~ \"$project\",vm_name =~ \"$VM\", device =~\"$In_adapter\"}", - "hide": false, - "interval": "", - "legendFormat": "__auto", - "range": true, - "refId": "A" - } - ], - "title": "Incoming Packets Error", - "type": "timeseries" - } - ] - }, - - { - "collapse": false, - "collapsed": false, - "repeat": null, - "repeatIteration": null, - "repeatRowId": null, - "showTitle": true, - "title": "Outbound Traffic", - "titleSize": "h6", - "type": "row", - "panels": [ - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": { "name": "` + dsName + `", "type": "prometheus" }, - "fieldConfig": { - "defaults": { - "links": [], - "unit": "p" - }, - "overrides": [] - }, - "fill": 10, - "fillGradient": 0, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 11 - }, - "hiddenSeries": false, - "id": 11, - "legend": { - "alignAsTable": true, - "avg": false, - "current": false, - "max": false, - "min": false, - "rightSide": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", - "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "10.4.3", - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "datasource": { "name": "` + dsName + `", "type": "prometheus" }, - "editorMode": "code", - "expr": "vm:ceilometer_network_outgoing_bytes:rate1m{resource_name=~\"$VM:$out_adapter\", project=~\"$project\"} / 1000000", - "hide": false, - "interval": "", - "legendFormat": "__auto", - "range": true, - "refId": "A" - } - ], - "thresholds": [], - "timeRegions": [], - "title": "Network Outgoing Packets", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "$$hashKey": "object:1127", - "format": "p", - "logBase": 1, - "show": true - }, - { - "$$hashKey": "object:1128", - "format": "short", - "logBase": 1, - "show": true - } - ], - "yaxis": { - "align": false - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": { "name": "` + dsName + `", "type": "prometheus" }, - "fieldConfig": { - "defaults": { - "links": [], - "unit": "p" - }, - "overrides": [] - }, - "fill": 10, - "fillGradient": 0, - "gridPos": { - "h": 9, - "w": 12, - "x": 12, - "y": 11 - }, - "hiddenSeries": false, - "id": 4, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", - "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "10.4.3", - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "datasource": { "name": "` + dsName + `", "type": "prometheus" }, - "editorMode": "code", - "expr": "vm:ceilometer_network_outgoing_packets_drop:rate1m{project =~ \"$project\", vm_name =~ \"$VM\", device=~\"$out_adapter\"}", - "hide": false, - "interval": "", - "legendFormat": "__auto", - "range": true, - "refId": "A" - } - ], - "thresholds": [], - "timeRegions": [], - "title": "Outgoing Dropped Packets", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "$$hashKey": "object:764", - "format": "p", - "logBase": 1, - "show": true - }, - { - "$$hashKey": "object:765", - "format": "short", - "logBase": 1, - "show": true - } - ], - "yaxis": { - "align": false - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": { "name": "` + dsName + `", "type": "prometheus" }, - "fieldConfig": { - "defaults": { - "links": [], - "unit": "percentunit" - }, - "overrides": [] - }, - "fill": 10, - "fillGradient": 0, - "gridPos": { - "h": 9, - "w": 12, - "x": 0, - "y": 19 - }, - "hiddenSeries": false, - "id": 13, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", - "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "10.4.3", - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "datasource": { "name": "` + dsName + `", "type": "prometheus" }, - "editorMode": "code", - "expr": "(rate(ceilometer_network_outgoing_packets_drop{project=~\"$project\", resource_name=~\"$VM:$out_adapter\"}[1m]) / rate(ceilometer_network_outgoing_packets{project=~\"$project\", resource_name=~\"$VM:$out_adapter\"}[1m])) * 100\n", - "hide": false, - "interval": "", - "legendFormat": "__auto", - "range": true, - "refId": "A" - } - ], - "thresholds": [ - { - "$$hashKey": "object:216", - "colorMode": "critical", - "fill": true, - "line": true, - "op": "gt", - "value": 80, - "yaxis": "left" - } - ], - "timeRegions": [], - "title": "Ountgoing Packet Loss (%)", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "$$hashKey": "object:1253", - "format": "percentunit", - "logBase": 1, - "show": true - }, - { - "$$hashKey": "object:1254", - "format": "short", - "logBase": 1, - "show": true - } - ], - "yaxis": { - "align": false - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": { "name": "` + dsName + `", "type": "prometheus" }, - "fieldConfig": { - "defaults": { - "links": [], - "unit": "p" - }, - "overrides": [] - }, - "fill": 10, - "fillGradient": 0, - "gridPos": { - "h": 9, - "w": 12, - "x": 12, - "y": 20 - }, - "hiddenSeries": false, - "id": 17, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", - "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "10.4.3", - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "datasource": { "name": "` + dsName + `", "type": "prometheus" }, - "editorMode": "code", - "expr": "vm:ceilometer_network_outgoing_packets_error:rate1m{project =~ \"$project\", vm_name =~ \"$VM\", device=~\"$out_adapter\"}", - "hide": false, - "interval": "", - "legendFormat": "__auto", - "range": true, - "refId": "A" - } - ], - "thresholds": [], - "timeRegions": [], - "title": "Outgoing Packets Error", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "$$hashKey": "object:764", - "format": "p", - "logBase": 1, - "show": true - }, - { - "$$hashKey": "object:765", - "format": "short", - "logBase": 1, - "show": true - } - ], - "yaxis": { - "align": false - } - } - ] - } - ], - - - "refresh": "10s", - "schemaVersion": 39, - "tags": [ - "openstack-telemetry-operator" - ], - "templating": { - "list": [ - { - "allValue": ".*", - "current": { - "selected": false, - "text": "", - "value": "" - }, - "datasource": { "name": "` + dsName + `", "type": "prometheus" }, - "definition": "label_values(vm:ceilometer_network_incoming_bytes:rate1m,vm_instance)", - "hide": 0, - "includeAll": true, - "multi": true, - "name": "compute_node", - "options": [], - "query": { - "qryType": 1, - "query": "label_values(vm:ceilometer_network_incoming_bytes:rate1m,vm_instance)", - "refId": "PrometheusVariableQueryEditor-VariableQuery" - }, - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "sort": 0, - "type": "query" - }, - { - "allValue": ".*", - "current": { - "selected": true, - "text": [ - "All" - ], - "value": [ - "$__all" - ] - }, - "datasource": { "name": "` + dsName + `", "type": "prometheus" }, - "definition": "label_values(ceilometer_cpu{vm_instance=~\"$compute_node\"},project)", - "hide": 0, - "includeAll": true, - "multi": true, - "name": "project", - "options": [], - "query": { - "qryType": 1, - "query": "label_values(ceilometer_cpu{vm_instance=~\"$compute_node\"},project)", - "refId": "PrometheusVariableQueryEditor-VariableQuery" - }, - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "sort": 1, - "tagValuesQuery": "", - "tagsQuery": "", - "type": "query", - "useTags": false - }, - { - "allValue": ".*", - "current": { - "selected": true, - "text": [ - "All" - ], - "value": [ - "$__all" - ] - }, - "datasource": { "name": "` + dsName + `", "type": "prometheus" }, - "definition": "label_values(ceilometer_cpu{project =~ \"$project\"}, vm_instance)", - "hide": 0, - "includeAll": true, - "multi": true, - "name": "VM", - "options": [], - "query": "label_values(vm:ceilometer_cpu:ratio1m{project =~ \"$project\"}, vm_name)", - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "sort": 0, - "tagValuesQuery": "", - "tagsQuery": "", - "type": "query", - "useTags": false - }, - { - "allValue": ".*", - "current": { - "selected": true, - "text": [ - "All" - ], - "value": [ - "$__all" - ] - }, - "datasource": { "name": "` + dsName + `", "type": "prometheus" }, - "definition": "label_values(vm:ceilometer_network_incoming_bytes:rate1m{vm_name=~\"$VM\"},device)", - "hide": 0, - "includeAll": true, - "multi": true, - "name": "In_adapter", - "options": [], - "query": { - "qryType": 1, - "query": "label_values(vm:ceilometer_network_incoming_bytes:rate1m{vm_name=~\"$VM\"},device)", - "refId": "PrometheusVariableQueryEditor-VariableQuery" - }, - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "sort": 0, - "type": "query" - }, - { - "allValue": ".*", - "current": { - "selected": false, - "text": "tap0cb7726a-da", - "value": "tap0cb7726a-da" - }, - "datasource": { "name": "` + dsName + `", "type": "prometheus" }, - "definition": "label_values(vm:ceilometer_network_outgoing_bytes:rate1m{vm_name=~\"$VM\"},device)", - "hide": 0, - "includeAll": true, - "multi": true, - "name": "out_adapter", - "options": [], - "query": { - "qryType": 1, - "query": "label_values(vm:ceilometer_network_outgoing_bytes:rate1m{vm_name=~\"$VM\"},device)", - "refId": "PrometheusVariableQueryEditor-VariableQuery" - }, - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "sort": 0, - "type": "query" - } - ] - }, - "time": { - "from": "now-6h", - "to": "now" - }, - "timepicker": { - "refresh_intervals": [ - "5s", - "10s", - "30s", - "1m", - "5m", - "15m", - "30m", - "1h", - "2h", - "1d" - ] - }, - "timezone": "", - "title": "OpenStack / VMs Network Traffic", - "version": 36, - "weekStart": "" - }`, + { + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "id": 1, + "links": [], + "rows": [ + { + "collapse": false, + "collapsed": false, + "repeat": null, + "repeatIteration": null, + "repeatRowId": null, + "showTitle": true, + "title": "Overview", + "titleSize": "h6", + "type": "row", + "panels": [ + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "name": "` + dsName + `", + "type": "prometheus" + }, + "fill": 10, + "fillGradient": 0, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 0 + }, + "hiddenSeries": false, + "id": 17, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "span": 6, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "vm:ceilometer_network_incoming_bytes:rate1m{project =~ \"$project\", vm_name =~ \"$VM\"}", + "legendFormat": "{{vm_name}} in ({{device}})", + "refId": "B" + }, + { + "expr": "vm:ceilometer_network_outgoing_bytes:rate1m{project =~ \"$project\", vm_name =~ \"$VM\"}", + "legendFormat": "{{vm_name}} out ({{device}})", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Network Adapter", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "watt", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "watt", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + } + ] + }, + { + "collapse": false, + "collapsed": false, + "repeat": null, + "repeatIteration": null, + "repeatRowId": null, + "showTitle": true, + "title": "Inbound Traffic", + "titleSize": "h6", + "type": "row", + "panels": [ + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "name": "` + dsName + `", + "type": "prometheus" + }, + "fieldConfig": { + "defaults": { + "links": [], + "unit": "p" + }, + "overrides": [] + }, + "fill": 10, + "fillGradient": 0, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 0 + }, + "hiddenSeries": false, + "id": 6, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "span": 6, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "vm:ceilometer_network_incoming_bytes:rate1m{resource_name=~\"$VM:$In_adapter\", project=~\"$project\" } / 1000000", + "legendFormat": "__auto", + "editorMode": "code", + "range": true, + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Network Incoming Packets", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "$$hashKey": "object:892", + "format": "p", + "logBase": 1, + "show": true + }, + { + "$$hashKey": "object:893", + "format": "short", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "name": "` + dsName + `", + "type": "prometheus" + }, + "fieldConfig": { + "defaults": { + "links": [], + "unit": "p" + }, + "overrides": [] + }, + "fill": 10, + "fillGradient": 0, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 0 + }, + "hiddenSeries": false, + "id": 6, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "span": 6, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "vm:ceilometer_network_incoming_packets_drop:rate1m{project =~ \"$project\",vm_name =~ \"$VM\", device =~\"$In_adapter\" }", + "legendFormat": "__auto", + "editorMode": "code", + "range": true, + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Incoming Dropped Packets", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "$$hashKey": "object:892", + "format": "p", + "logBase": 1, + "show": true + }, + { + "$$hashKey": "object:893", + "format": "short", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "name": "` + dsName + `", + "type": "prometheus" + }, + "fieldConfig": { + "defaults": { + "links": [], + "unit": "p" + }, + "overrides": [] + }, + "fill": 10, + "fillGradient": 0, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 0 + }, + "hiddenSeries": false, + "id": 6, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "span": 6, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "(rate(ceilometer_network_incoming_packets_drop{project=~\"$project\", resource_name=~\"$VM:$In_adapter\"}[1m]) / rate(ceilometer_network_incoming_packets{project=~\"$project\", resource_name=~\"$VM:In_adapter\"}[1m])) * 100\n", + "legendFormat": "__auto", + "editorMode": "code", + "range": true, + "refId": "A" + } + ], + "thresholds": [ + { + "$$hashKey": "object:151", + "colorMode": "critical", + "fill": true, + "line": true, + "op": "gt", + "value": 30, + "yaxis": "left" + } + ], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Incoming Packet Loss (%)", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "$$hashKey": "object:946", + "format": "percentunit", + "logBase": 1, + "show": true + }, + { + "$$hashKey": "object:947", + "format": "short", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "name": "` + dsName + `", + "type": "prometheus" + }, + "fieldConfig": { + "defaults": { + "links": [], + "unit": "p" + }, + "overrides": [] + }, + "fill": 10, + "fillGradient": 0, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 0 + }, + "hiddenSeries": false, + "id": 6, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "span": 6, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "vm:ceilometer_network_incoming_packets_error:rate1m{project =~ \"$project\",vm_name =~ \"$VM\", device =~\"$In_adapter\"}", + "legendFormat": "__auto", + "editorMode": "code", + "range": true, + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Incoming Packets Error", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "$$hashKey": "object:946", + "format": "percentunit", + "logBase": 1, + "show": true + }, + { + "$$hashKey": "object:947", + "format": "short", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + } + ] + }, + { + "collapse": false, + "collapsed": false, + "repeat": null, + "repeatIteration": null, + "repeatRowId": null, + "showTitle": true, + "title": "Outbound Traffic", + "titleSize": "h6", + "type": "row", + "panels": [ + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "name": "` + dsName + `", + "type": "prometheus" + }, + "fieldConfig": { + "defaults": { + "links": [], + "unit": "p" + }, + "overrides": [] + }, + "fill": 10, + "fillGradient": 0, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 0 + }, + "hiddenSeries": false, + "id": 6, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "span": 6, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "vm:ceilometer_network_outgoing_bytes:rate1m{resource_name=~\"$VM:$In_adapter\", project=~\"$project\" } / 1000000", + "legendFormat": "__auto", + "editorMode": "code", + "range": true, + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Network Outgoing Packets", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "$$hashKey": "object:892", + "format": "p", + "logBase": 1, + "show": true + }, + { + "$$hashKey": "object:893", + "format": "short", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "name": "` + dsName + `", + "type": "prometheus" + }, + "fieldConfig": { + "defaults": { + "links": [], + "unit": "p" + }, + "overrides": [] + }, + "fill": 10, + "fillGradient": 0, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 0 + }, + "hiddenSeries": false, + "id": 6, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "span": 6, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "vm:ceilometer_network_outgoing_packets_drop:rate1m{project =~ \"$project\",vm_name =~ \"$VM\", device =~\"$In_adapter\" }", + "legendFormat": "__auto", + "editorMode": "code", + "range": true, + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Outgoing Dropped Packets", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "$$hashKey": "object:892", + "format": "p", + "logBase": 1, + "show": true + }, + { + "$$hashKey": "object:893", + "format": "short", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "name": "` + dsName + `", + "type": "prometheus" + }, + "fieldConfig": { + "defaults": { + "links": [], + "unit": "p" + }, + "overrides": [] + }, + "fill": 10, + "fillGradient": 0, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 0 + }, + "hiddenSeries": false, + "id": 6, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "span": 6, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "(rate(ceilometer_network_outgoing_packets_drop{project=~\"$project\", resource_name=~\"$VM:$In_adapter\"}[1m]) / rate(ceilometer_network_incoming_packets{project=~\"$project\", resource_name=~\"$VM:In_adapter\"}[1m])) * 100\n", + "legendFormat": "__auto", + "editorMode": "code", + "range": true, + "refId": "A" + } + ], + "thresholds": [ + { + "$$hashKey": "object:151", + "colorMode": "critical", + "fill": true, + "line": true, + "op": "gt", + "value": 30, + "yaxis": "left" + } + ], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Outgoing Packet Loss (%)", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "$$hashKey": "object:946", + "format": "percentunit", + "logBase": 1, + "show": true + }, + { + "$$hashKey": "object:947", + "format": "short", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "name": "` + dsName + `", + "type": "prometheus" + }, + "fieldConfig": { + "defaults": { + "links": [], + "unit": "p" + }, + "overrides": [] + }, + "fill": 10, + "fillGradient": 0, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 0 + }, + "hiddenSeries": false, + "id": 6, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "span": 6, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "vm:ceilometer_network_outgoing_packets_error:rate1m{project =~ \"$project\",vm_name =~ \"$VM\", device =~\"$In_adapter\"}", + "legendFormat": "__auto", + "editorMode": "code", + "range": true, + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Outgoing Packets Error", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "$$hashKey": "object:946", + "format": "percentunit", + "logBase": 1, + "show": true + }, + { + "$$hashKey": "object:947", + "format": "short", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + } + ] + } + ], + "schemaVersion": 21, + "style": "dark", + "tags": [ + "openstack-telemetry-operator" + ], + "templating": { + "list": [ + { + "allValue": ".*", + "current": { + "text": "", + "value": "" + }, + "datasource": { + "name": "` + dsName + `", + "type": "prometheus" + }, + "definition": "label_values(vm:ceilometer_network_incoming_bytes:rate1m,vm_instance)", + "hide": 0, + "includeAll": true, + "label": null, + "multi": true, + "name": "compute_node", + "options": [], + "query": "label_values(vm:ceilometer_network_incoming_bytes:rate1m,vm_instance)", + "refresh": 0, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "allValue": ".*", + "current": { + "text": "", + "value": "" + }, + "datasource": { + "name": "` + dsName + `", + "type": "prometheus" + }, + "definition": "label_values(ceilometer_cpu{vm_instance=~\"$compute_node\"},project)", + "hide": 0, + "includeAll": true, + "label": null, + "multi": true, + "name": "project", + "options": [], + "query": "label_values(ceilometer_cpu{vm_instance=~\"$compute_node\"},project)", + "refresh": 0, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "allValue": ".*", + "current": { + "text": "", + "value": "" + }, + "datasource": { + "name": "` + dsName + `", + "type": "prometheus" + }, + "definition": "label_values(ceilometer_cpu{project =~ \"$project\"}, vm_instance)", + "hide": 0, + "includeAll": true, + "label": null, + "multi": true, + "name": "VM", + "options": [], + "query": "label_values(vm:ceilometer_cpu:ratio1m{project =~ \"$project\"}, vm_name)", + "refresh": 0, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "allValue": ".*", + "current": { + "text": "", + "value": "" + }, + "datasource": { + "name": "` + dsName + `", + "type": "prometheus" + }, + "definition": "label_values(vm:ceilometer_network_incoming_bytes:rate1m{vm_name=~\"$VM\"},device)", + "hide": 0, + "includeAll": true, + "label": null, + "multi": true, + "name": "In_adapter", + "options": [], + "query": "label_values(vm:ceilometer_network_incoming_bytes:rate1m{vm_name=~\"$VM\"},device)", + "refresh": 0, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "allValue": ".*", + "current": { + "text": "", + "value": "" + }, + "datasource": { + "name": "` + dsName + `", + "type": "prometheus" + }, + "definition": "label_values(ceilometer_cpu{project =~ \"$project\"}, vm_instance)", + "hide": 0, + "includeAll": true, + "label": null, + "multi": true, + "name": "VM", + "options": [], + "query": "label_values(vm:ceilometer_cpu:ratio1m{project =~ \"$project\"}, vm_name)", + "refresh": 0, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "allValue": ".*", + "current": { + "text": "", + "value": "" + }, + "datasource": { + "name": "` + dsName + `", + "type": "prometheus" + }, + "definition": "label_values(vm:ceilometer_network_outgoing_bytes:rate1m{vm_name=~\"$VM\"},device)", + "hide": 0, + "includeAll": true, + "label": null, + "multi": true, + "name": "out_adapter", + "options": [], + "query": "label_values(vm:ceilometer_network_outgoing_bytes:rate1m{vm_name=~\"$VM\"},device)", + "refresh": 0, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + } + ] + }, + "time": { + "from": "now-5m", + "to": "now" + }, + "timepicker": { + "refresh_intervals": [ + "5s", + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ] + }, + "timezone": "", + "title": "OpenStack / VMs Network Traffic", + "version": 7 + }`, }, } return dashboardCM -} +} \ No newline at end of file From 029e20f0355f5e4d462e368ef183926d39c346b9 Mon Sep 17 00:00:00 2001 From: mgirgisf Date: Mon, 16 Dec 2024 14:05:05 +0200 Subject: [PATCH 6/8] update template --- pkg/dashboards/openstack-network-traffic.go | 67 ++++++--------------- 1 file changed, 20 insertions(+), 47 deletions(-) diff --git a/pkg/dashboards/openstack-network-traffic.go b/pkg/dashboards/openstack-network-traffic.go index 9c99e128..c541c03e 100644 --- a/pkg/dashboards/openstack-network-traffic.go +++ b/pkg/dashboards/openstack-network-traffic.go @@ -993,14 +993,14 @@ func OpenstackNetworkTraffic(dsName string) *corev1.ConfigMap { "name": "` + dsName + `", "type": "prometheus" }, - "definition": "label_values(vm:ceilometer_network_incoming_bytes:rate1m,vm_instance)", + "definition": "label_values(ceilometer_cpu, vm_instance)", "hide": 0, "includeAll": true, "label": null, "multi": true, - "name": "compute_node", + "name": "Compute_node", "options": [], - "query": "label_values(vm:ceilometer_network_incoming_bytes:rate1m,vm_instance)", + "query": "label_values(vm:ceilometer_cpu:ratio1m, vm_instance)", "refresh": 0, "regex": "", "skipUrlSync": false, @@ -1014,25 +1014,26 @@ func OpenstackNetworkTraffic(dsName string) *corev1.ConfigMap { { "allValue": ".*", "current": { - "text": "", - "value": "" - }, - "datasource": { - "name": "` + dsName + `", - "type": "prometheus" + "tags": [], + "text": "539c3dc2361f4fd191aaa21c14360e35", + "value": [ + "539c3dc2361f4fd191aaa21c14360e35" + ] }, - "definition": "label_values(ceilometer_cpu{vm_instance=~\"$compute_node\"},project)", + "datasource": { "name": "` + dsName + `", "type": "prometheus" }, + "definition": "label_values(ceilometer_cpu, project)", "hide": 0, "includeAll": true, + "index": -1, "label": null, "multi": true, "name": "project", "options": [], - "query": "label_values(ceilometer_cpu{vm_instance=~\"$compute_node\"},project)", + "query": "label_values(ceilometer_cpu, project)", "refresh": 0, "regex": "", "skipUrlSync": false, - "sort": 0, + "sort": 1, "tagValuesQuery": "", "tags": [], "tagsQuery": "", @@ -1077,42 +1078,14 @@ func OpenstackNetworkTraffic(dsName string) *corev1.ConfigMap { "name": "` + dsName + `", "type": "prometheus" }, - "definition": "label_values(vm:ceilometer_network_incoming_bytes:rate1m{vm_name=~\"$VM\"},device)", + "definition": "label_values(ceilometer_network_incoming_bytes{vm_name=~\"$VM\"}, device)", "hide": 0, "includeAll": true, "label": null, "multi": true, "name": "In_adapter", "options": [], - "query": "label_values(vm:ceilometer_network_incoming_bytes:rate1m{vm_name=~\"$VM\"},device)", - "refresh": 0, - "regex": "", - "skipUrlSync": false, - "sort": 0, - "tagValuesQuery": "", - "tags": [], - "tagsQuery": "", - "type": "query", - "useTags": false - }, - { - "allValue": ".*", - "current": { - "text": "", - "value": "" - }, - "datasource": { - "name": "` + dsName + `", - "type": "prometheus" - }, - "definition": "label_values(ceilometer_cpu{project =~ \"$project\"}, vm_instance)", - "hide": 0, - "includeAll": true, - "label": null, - "multi": true, - "name": "VM", - "options": [], - "query": "label_values(vm:ceilometer_cpu:ratio1m{project =~ \"$project\"}, vm_name)", + "query": "label_values(ceilometer_network_incoming_bytes{vm_name=~\"$VM\"}, device)", "refresh": 0, "regex": "", "skipUrlSync": false, @@ -1133,18 +1106,18 @@ func OpenstackNetworkTraffic(dsName string) *corev1.ConfigMap { "name": "` + dsName + `", "type": "prometheus" }, - "definition": "label_values(vm:ceilometer_network_outgoing_bytes:rate1m{vm_name=~\"$VM\"},device)", + "definition": "label_values(ceilometer_network_outgoing_bytes{vm_name=~\"$VM\"}, device)", "hide": 0, "includeAll": true, "label": null, "multi": true, - "name": "out_adapter", + "name": "Out_adapter", "options": [], - "query": "label_values(vm:ceilometer_network_outgoing_bytes:rate1m{vm_name=~\"$VM\"},device)", - "refresh": 0, + "query": "label_values(ceilometer_network_outgoing_bytes{vm_name=~\"$VM\"}, device)", + "refresh": 1, "regex": "", "skipUrlSync": false, - "sort": 0, + "sort": 1, "tagValuesQuery": "", "tags": [], "tagsQuery": "", From bff1ec09e06447e9ccf64148379979bed74019a2 Mon Sep 17 00:00:00 2001 From: mgirgisf Date: Mon, 16 Dec 2024 14:47:25 +0200 Subject: [PATCH 7/8] update template --- pkg/dashboards/openstack-network-traffic.go | 73 ++++++++++++++------- 1 file changed, 48 insertions(+), 25 deletions(-) diff --git a/pkg/dashboards/openstack-network-traffic.go b/pkg/dashboards/openstack-network-traffic.go index c541c03e..ecfbf27d 100644 --- a/pkg/dashboards/openstack-network-traffic.go +++ b/pkg/dashboards/openstack-network-traffic.go @@ -219,12 +219,11 @@ func OpenstackNetworkTraffic(dsName string) *corev1.ConfigMap { "renderer": "flot", "seriesOverrides": [], "spaceLength": 10, - "span": 6, "stack": false, "steppedLine": false, "targets": [ { - "expr": "vm:ceilometer_network_incoming_bytes:rate1m{resource_name=~\"$VM:$In_adapter\", project=~\"$project\" } / 1000000", + "expr": "vm:ceilometer_network_incoming_bytes:rate1m{resource_name=~\"$VM:.*\", project=~\"$project\" } / 1000000", "legendFormat": "__auto", "editorMode": "code", "range": true, @@ -243,7 +242,6 @@ func OpenstackNetworkTraffic(dsName string) *corev1.ConfigMap { }, "type": "graph", "xaxis": { - "buckets": null, "mode": "time", "name": null, "show": true, @@ -251,13 +249,13 @@ func OpenstackNetworkTraffic(dsName string) *corev1.ConfigMap { }, "yaxes": [ { - "$$hashKey": "object:892", + "$$hashKey": "object:946", "format": "p", "logBase": 1, "show": true }, { - "$$hashKey": "object:893", + "$$hashKey": "object:947", "format": "short", "logBase": 1, "show": true @@ -280,7 +278,7 @@ func OpenstackNetworkTraffic(dsName string) *corev1.ConfigMap { "fieldConfig": { "defaults": { "links": [], - "unit": "p" + "unit": "percentunit" }, "overrides": [] }, @@ -327,7 +325,17 @@ func OpenstackNetworkTraffic(dsName string) *corev1.ConfigMap { "refId": "A" } ], - "thresholds": [], + "thresholds": [ + { + "$$hashKey": "object:151", + "colorMode": "critical", + "fill": true, + "line": true, + "op": "gt", + "value": 30, + "yaxis": "left" + } + ], "timeFrom": null, "timeRegions": [], "timeShift": null, @@ -347,13 +355,13 @@ func OpenstackNetworkTraffic(dsName string) *corev1.ConfigMap { }, "yaxes": [ { - "$$hashKey": "object:892", - "format": "p", + "$$hashKey": "object:946", + "format": "percentunit", "logBase": 1, "show": true }, { - "$$hashKey": "object:893", + "$$hashKey": "object:947", "format": "short", "logBase": 1, "show": true @@ -492,7 +500,7 @@ func OpenstackNetworkTraffic(dsName string) *corev1.ConfigMap { "h": 8, "w": 12, "x": 0, - "y": 0 + "y": 10 }, "hiddenSeries": false, "id": 6, @@ -525,6 +533,8 @@ func OpenstackNetworkTraffic(dsName string) *corev1.ConfigMap { "expr": "vm:ceilometer_network_incoming_packets_error:rate1m{project =~ \"$project\",vm_name =~ \"$VM\", device =~\"$In_adapter\"}", "legendFormat": "__auto", "editorMode": "code", + "hide": false, + "interval": "", "range": true, "refId": "A" } @@ -550,7 +560,7 @@ func OpenstackNetworkTraffic(dsName string) *corev1.ConfigMap { "yaxes": [ { "$$hashKey": "object:946", - "format": "percentunit", + "format": "p", "logBase": 1, "show": true }, @@ -998,7 +1008,7 @@ func OpenstackNetworkTraffic(dsName string) *corev1.ConfigMap { "includeAll": true, "label": null, "multi": true, - "name": "Compute_node", + "name": "compute_node", "options": [], "query": "label_values(vm:ceilometer_cpu:ratio1m, vm_instance)", "refresh": 0, @@ -1021,7 +1031,7 @@ func OpenstackNetworkTraffic(dsName string) *corev1.ConfigMap { ] }, "datasource": { "name": "` + dsName + `", "type": "prometheus" }, - "definition": "label_values(ceilometer_cpu, project)", + "definition": "label_values(ceilometer_cpu{vm_instance=~\"$compute_node\"}, project)", "hide": 0, "includeAll": true, "index": -1, @@ -1029,7 +1039,7 @@ func OpenstackNetworkTraffic(dsName string) *corev1.ConfigMap { "multi": true, "name": "project", "options": [], - "query": "label_values(ceilometer_cpu, project)", + "query": "label_values(ceilometer_cpu{vm_instance=~\"$compute_node\"}, project)", "refresh": 0, "regex": "", "skipUrlSync": false, @@ -1071,21 +1081,27 @@ func OpenstackNetworkTraffic(dsName string) *corev1.ConfigMap { { "allValue": ".*", "current": { - "text": "", - "value": "" - }, + "selected": true, + "text": [ + "tap0cb7726a-da" + ], + "value": [ + "tap0cb7726a-da" + ] + }, "datasource": { "name": "` + dsName + `", "type": "prometheus" }, - "definition": "label_values(ceilometer_network_incoming_bytes{vm_name=~\"$VM\"}, device)", + "definition": "label_values(vm:ceilometer_network_incoming_bytes:rate1m{vm_name=~\"$VM\"}, device)", "hide": 0, "includeAll": true, + "index": -1, "label": null, "multi": true, "name": "In_adapter", "options": [], - "query": "label_values(ceilometer_network_incoming_bytes{vm_name=~\"$VM\"}, device)", + "query": "label_values(vm:ceilometer_network_incoming_bytes:rate1m{vm_name=~\"$VM\"}, device)", "refresh": 0, "regex": "", "skipUrlSync": false, @@ -1099,21 +1115,28 @@ func OpenstackNetworkTraffic(dsName string) *corev1.ConfigMap { { "allValue": ".*", "current": { - "text": "", - "value": "" - }, + "selected": true, + "text": [ + "tap0cb7726a-da", + "tapfb47a4c6-9f" + ], + "value": [ + "tap0cb7726a-da", + "tapfb47a4c6-9f" + ] + }, "datasource": { "name": "` + dsName + `", "type": "prometheus" }, - "definition": "label_values(ceilometer_network_outgoing_bytes{vm_name=~\"$VM\"}, device)", + "definition": "label_values(vm:ceilometer_network_outgoing_bytes:rate1m, device)", "hide": 0, "includeAll": true, "label": null, "multi": true, "name": "Out_adapter", "options": [], - "query": "label_values(ceilometer_network_outgoing_bytes{vm_name=~\"$VM\"}, device)", + "query": "label_values(vm:ceilometer_network_outgoing_bytes:rate1m, device)", "refresh": 1, "regex": "", "skipUrlSync": false, From 554969d10599bac6e99dde7569700c423984dfa6 Mon Sep 17 00:00:00 2001 From: mgirgisf Date: Mon, 16 Dec 2024 14:58:17 +0200 Subject: [PATCH 8/8] solve precommit --- pkg/dashboards/openstack-network-traffic.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/dashboards/openstack-network-traffic.go b/pkg/dashboards/openstack-network-traffic.go index ecfbf27d..fb0bd0b0 100644 --- a/pkg/dashboards/openstack-network-traffic.go +++ b/pkg/dashboards/openstack-network-traffic.go @@ -1175,4 +1175,4 @@ func OpenstackNetworkTraffic(dsName string) *corev1.ConfigMap { } return dashboardCM -} \ No newline at end of file +}