diff --git a/Documentation/README.md b/Documentation/README.md index 050777d6..75f31e96 100644 --- a/Documentation/README.md +++ b/Documentation/README.md @@ -269,4 +269,5 @@ kubectl annotate service my-service "kube-router.io/service.scheduler=dh" [Configuring BGP Peers](bgp.md) ## Metrics + [Configure metrics gathering](metrics.md) diff --git a/Documentation/metrics.md b/Documentation/metrics.md index 47eb9104..d8690c52 100644 --- a/Documentation/metrics.md +++ b/Documentation/metrics.md @@ -63,4 +63,10 @@ The following metrics is exposed by kube-router prefixed by `kube_router_` Outgoing bytes per second To get a grouped list of CPS for each service a Prometheus query could look like this e.g: -`sum(kube_router_service_cps) by (namespace, service_name)` \ No newline at end of file +`sum(kube_router_service_cps) by (namespace, service_name)` + +## Grafana Dashboard + +This repo contains a example [Grafana dashboard](https://grafana.com/) utilizing all the above exposed metrics from kube-router. +[kube-router.json](https://raw.githubusercontent.com/cloudnativelabs/kube-router/master/dashboard/kube-router.json) +[dashboard.png](https://raw.githubusercontent.com/cloudnativelabs/kube-router/master/dashboard/dashboard.png) diff --git a/app/controllers/network_services_controller.go b/app/controllers/network_services_controller.go index 5a49f850..16327d90 100644 --- a/app/controllers/network_services_controller.go +++ b/app/controllers/network_services_controller.go @@ -49,53 +49,53 @@ var ( serviceTotalConn = prometheus.NewGaugeVec(prometheus.GaugeOpts{ Namespace: namespace, Name: "service_total_connections", - Help: "Total conntection to service", - }, []string{"namespace", "service_name", "service_vip"}) + Help: "Total incoming conntections made", + }, []string{"namespace", "service_name", "service_vip", "protocol", "port"}) servicePacketsIn = prometheus.NewGaugeVec(prometheus.GaugeOpts{ Namespace: namespace, Name: "service_packets_in", Help: "Total incoming packets", - }, []string{"namespace", "service_name", "service_vip"}) + }, []string{"namespace", "service_name", "service_vip", "protocol", "port"}) servicePacketsOut = prometheus.NewGaugeVec(prometheus.GaugeOpts{ Namespace: namespace, Name: "service_packets_out", Help: "Total outoging packets", - }, []string{"namespace", "service_name", "service_vip"}) + }, []string{"namespace", "service_name", "service_vip", "protocol", "port"}) serviceBytesIn = prometheus.NewGaugeVec(prometheus.GaugeOpts{ Namespace: namespace, Name: "service_bytes_in", Help: "Total incoming bytes", - }, []string{"namespace", "service_name", "service_vip"}) + }, []string{"namespace", "service_name", "service_vip", "protocol", "port"}) serviceBytesOut = prometheus.NewGaugeVec(prometheus.GaugeOpts{ Namespace: namespace, Name: "service_bytes_out", - Help: "Total outoging bytes", - }, []string{"namespace", "service_name", "service_vip"}) + Help: "Total outgoing bytes", + }, []string{"namespace", "service_name", "service_vip", "protocol", "port"}) servicePpsIn = prometheus.NewGaugeVec(prometheus.GaugeOpts{ Namespace: namespace, Name: "service_pps_in", Help: "Incoming packets per second", - }, []string{"namespace", "service_name", "service_vip"}) + }, []string{"namespace", "service_name", "service_vip", "protocol", "port"}) servicePpsOut = prometheus.NewGaugeVec(prometheus.GaugeOpts{ Namespace: namespace, Name: "service_pps_out", Help: "Outoging packets per second", - }, []string{"namespace", "service_name", "service_vip"}) + }, []string{"namespace", "service_name", "service_vip", "protocol", "port"}) serviceCPS = prometheus.NewGaugeVec(prometheus.GaugeOpts{ Namespace: namespace, Name: "service_cps", Help: "Service connections per second", - }, []string{"namespace", "service_name", "service_vip"}) + }, []string{"namespace", "service_name", "service_vip", "protocol", "port"}) serviceBpsIn = prometheus.NewGaugeVec(prometheus.GaugeOpts{ Namespace: namespace, Name: "service_bps_in", Help: "Incoming bytes per second", - }, []string{"namespace", "service_name", "service_vip"}) + }, []string{"namespace", "service_name", "service_vip", "protocol", "port"}) serviceBpsOut = prometheus.NewGaugeVec(prometheus.GaugeOpts{ Namespace: namespace, Name: "service_bps_out", Help: "Outoging bytes per second", - }, []string{"namespace", "service_name", "service_vip"}) + }, []string{"namespace", "service_name", "service_vip", "protocol", "port"}) ) // NetworkServicesController enables local node as network service proxy through IPVS/LVS. @@ -782,40 +782,52 @@ func (nsc *NetworkServicesController) publishMetrics(serviceInfoMap serviceInfoM for _, svc := range serviceInfoMap { var protocol uint16 - if svc.protocol == "tcp" { - protocol = syscall.IPPROTO_TCP - } else { - protocol = syscall.IPPROTO_UDP - } - for _, ipvsSvc := range ipvsSvcs { - if strings.Compare(svc.clusterIP.String(), ipvsSvc.Address.String()) == 0 && - protocol == ipvsSvc.Protocol && uint16(svc.port) == ipvsSvc.Port { - glog.Infof("Publishing prometheus metrics " + svc.clusterIP.String() + ":" + strconv.Itoa(svc.port)) - serviceBpsIn.WithLabelValues(svc.namespace, svc.name, svc.clusterIP.String()).Set(float64(ipvsSvc.Stats.BPSIn)) - serviceBpsOut.WithLabelValues(svc.namespace, svc.name, svc.clusterIP.String()).Set(float64(ipvsSvc.Stats.BPSOut)) - serviceBytesIn.WithLabelValues(svc.namespace, svc.name, svc.clusterIP.String()).Set(float64(ipvsSvc.Stats.BytesIn)) - serviceBytesOut.WithLabelValues(svc.namespace, svc.name, svc.clusterIP.String()).Set(float64(ipvsSvc.Stats.BytesOut)) - serviceCPS.WithLabelValues(svc.namespace, svc.name, svc.clusterIP.String()).Set(float64(ipvsSvc.Stats.CPS)) - servicePacketsIn.WithLabelValues(svc.namespace, svc.name, svc.clusterIP.String()).Set(float64(ipvsSvc.Stats.PacketsIn)) - servicePacketsOut.WithLabelValues(svc.namespace, svc.name, svc.clusterIP.String()).Set(float64(ipvsSvc.Stats.PacketsOut)) - servicePpsIn.WithLabelValues(svc.namespace, svc.name, svc.clusterIP.String()).Set(float64(ipvsSvc.Stats.PPSIn)) - servicePpsOut.WithLabelValues(svc.namespace, svc.name, svc.clusterIP.String()).Set(float64(ipvsSvc.Stats.PPSOut)) - serviceTotalConn.WithLabelValues(svc.namespace, svc.name, svc.clusterIP.String()).Set(float64(ipvsSvc.Stats.Connections)) + var pushMetric bool + var svcVip string + switch aProtocol := svc.protocol; aProtocol { + case "tcp": + protocol = syscall.IPPROTO_TCP + case "udp": + protocol = syscall.IPPROTO_UDP + default: + protocol = syscall.IPPROTO_NONE + } + glog.Info("Publishing Prometheus metrics") + for _, ipvsSvc := range ipvsSvcs { + + switch svcAddress := ipvsSvc.Address.String(); svcAddress { + case svc.clusterIP.String(): + if protocol == ipvsSvc.Protocol && uint16(svc.port) == ipvsSvc.Port { + pushMetric = true + svcVip = svc.clusterIP.String() + } else { + pushMetric = false + } + case nsc.nodeIP.String(): + if protocol == ipvsSvc.Protocol && uint16(svc.port) == ipvsSvc.Port { + pushMetric = true + svcVip = nsc.nodeIP.String() + } else { + pushMetric = false + } + default: + svcVip = "" + pushMetric = false } - if strings.Compare(nsc.nodeIP.String(), ipvsSvc.Address.String()) == 0 && - protocol == ipvsSvc.Protocol && uint16(svc.port) == ipvsSvc.Port { - glog.Infof("Publishing prometheus metrics " + nsc.nodeIP.String() + ":" + strconv.Itoa(svc.port)) - serviceBpsIn.WithLabelValues(svc.namespace, svc.name, nsc.nodeIP.String()).Set(float64(ipvsSvc.Stats.BPSIn)) - serviceBpsOut.WithLabelValues(svc.namespace, svc.name, nsc.nodeIP.String()).Set(float64(ipvsSvc.Stats.BPSOut)) - serviceBytesIn.WithLabelValues(svc.namespace, svc.name, nsc.nodeIP.String()).Set(float64(ipvsSvc.Stats.BytesIn)) - serviceBytesOut.WithLabelValues(svc.namespace, svc.name, nsc.nodeIP.String()).Set(float64(ipvsSvc.Stats.BytesOut)) - serviceCPS.WithLabelValues(svc.namespace, svc.name, nsc.nodeIP.String()).Set(float64(ipvsSvc.Stats.CPS)) - servicePacketsIn.WithLabelValues(svc.namespace, svc.name, nsc.nodeIP.String()).Set(float64(ipvsSvc.Stats.PacketsIn)) - servicePacketsOut.WithLabelValues(svc.namespace, svc.name, nsc.nodeIP.String()).Set(float64(ipvsSvc.Stats.PacketsOut)) - servicePpsIn.WithLabelValues(svc.namespace, svc.name, nsc.nodeIP.String()).Set(float64(ipvsSvc.Stats.PPSIn)) - servicePpsOut.WithLabelValues(svc.namespace, svc.name, nsc.nodeIP.String()).Set(float64(ipvsSvc.Stats.PPSOut)) - serviceTotalConn.WithLabelValues(svc.namespace, svc.name, nsc.nodeIP.String()).Set(float64(ipvsSvc.Stats.Connections)) + + if pushMetric { + glog.V(3).Infof("Publishing metrics for %s/%s (%s:%d/%s)", svc.namespace, svc.name, svcVip, svc.port, svc.protocol) + serviceBpsIn.WithLabelValues(svc.namespace, svc.name, svcVip, svc.protocol, strconv.Itoa(svc.port)).Set(float64(ipvsSvc.Stats.BPSIn)) + serviceBpsOut.WithLabelValues(svc.namespace, svc.name, svcVip, svc.protocol, strconv.Itoa(svc.port)).Set(float64(ipvsSvc.Stats.BPSOut)) + serviceBytesIn.WithLabelValues(svc.namespace, svc.name, svcVip, svc.protocol, strconv.Itoa(svc.port)).Set(float64(ipvsSvc.Stats.BytesIn)) + serviceBytesOut.WithLabelValues(svc.namespace, svc.name, svcVip, svc.protocol, strconv.Itoa(svc.port)).Set(float64(ipvsSvc.Stats.BytesOut)) + serviceCPS.WithLabelValues(svc.namespace, svc.name, svcVip, svc.protocol, strconv.Itoa(svc.port)).Set(float64(ipvsSvc.Stats.CPS)) + servicePacketsIn.WithLabelValues(svc.namespace, svc.name, svcVip, svc.protocol, strconv.Itoa(svc.port)).Set(float64(ipvsSvc.Stats.PacketsIn)) + servicePacketsOut.WithLabelValues(svc.namespace, svc.name, svcVip, svc.protocol, strconv.Itoa(svc.port)).Set(float64(ipvsSvc.Stats.PacketsOut)) + servicePpsIn.WithLabelValues(svc.namespace, svc.name, svcVip, svc.protocol, strconv.Itoa(svc.port)).Set(float64(ipvsSvc.Stats.PPSIn)) + servicePpsOut.WithLabelValues(svc.namespace, svc.name, svcVip, svc.protocol, strconv.Itoa(svc.port)).Set(float64(ipvsSvc.Stats.PPSOut)) + serviceTotalConn.WithLabelValues(svc.namespace, svc.name, svcVip, svc.protocol, strconv.Itoa(svc.port)).Set(float64(ipvsSvc.Stats.Connections)) } } } diff --git a/dashboard/dashboard.png b/dashboard/dashboard.png new file mode 100644 index 00000000..9f450635 Binary files /dev/null and b/dashboard/dashboard.png differ diff --git a/dashboard/kube-router.json b/dashboard/kube-router.json new file mode 100644 index 00000000..623d968c --- /dev/null +++ b/dashboard/kube-router.json @@ -0,0 +1,920 @@ +{ + "__inputs": [ + { + "name": "DS_PROMETHEUS", + "label": "prometheus", + "description": "", + "type": "datasource", + "pluginId": "prometheus", + "pluginName": "Prometheus" + } + ], + "__requires": [ + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "4.6.2" + }, + { + "type": "panel", + "id": "graph", + "name": "Graph", + "version": "" + }, + { + "type": "datasource", + "id": "prometheus", + "name": "Prometheus", + "version": "1.0.0" + } + ], + "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": 2, + "hideControls": false, + "id": null, + "links": [], + "refresh": "30s", + "rows": [ + { + "collapse": false, + "height": 300, + "panels": [ + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_PROMETHEUS}", + "description": "", + "fill": 1, + "id": 4, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "hideEmpty": true, + "hideZero": true, + "max": false, + "min": false, + "rightSide": true, + "show": false, + "sort": "max", + "sortDesc": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "span": 6, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(kube_router_service_cps) by (namespace, service_name, protocol, port)", + "format": "time_series", + "instant": false, + "intervalFactor": 2, + "legendFormat": "{{namespace}}/{{service_name}} {{port}}/{{protocol}}", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "CPS", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ] + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_PROMETHEUS}", + "fill": 1, + "id": 13, + "legend": { + "alignAsTable": true, + "avg": false, + "current": false, + "max": false, + "min": false, + "rightSide": true, + "show": false, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "span": 6, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(kube_router_service_bps_in) by (instance)", + "format": "time_series", + "instant": false, + "intervalFactor": 2, + "legendFormat": "in: {{instance}}", + "refId": "A" + }, + { + "expr": "- sum(kube_router_service_bps_out) by (instance)", + "format": "time_series", + "intervalFactor": 2, + "legendFormat": "out: {{instance}}", + "refId": "B" + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Traffic by node", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "Bps", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ] + } + ], + "repeat": null, + "repeatIteration": null, + "repeatRowId": null, + "showTitle": false, + "title": "Dashboard Row", + "titleSize": "h3" + }, + { + "collapse": false, + "height": 337, + "panels": [ + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_PROMETHEUS}", + "fill": 1, + "id": 2, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "hideEmpty": true, + "hideZero": true, + "max": false, + "min": false, + "rightSide": true, + "show": false, + "sort": "current", + "sortDesc": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "span": 6, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(kube_router_service_pps_in) by (namespace, service_name, protocol, port)", + "format": "time_series", + "intervalFactor": 2, + "legendFormat": "in {{namespace}}/{{service_name}} {{port}}/{{protocol}}", + "refId": "A" + }, + { + "expr": "- sum(kube_router_service_pps_out) by (namespace, service_name, protocol, port)", + "format": "time_series", + "intervalFactor": 2, + "legendFormat": "out {{namespace}}/{{service_name}} {{port}}/{{protocol}}", + "refId": "B" + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "PPS", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "pps", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": false + } + ] + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_PROMETHEUS}", + "fill": 1, + "id": 7, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "hideEmpty": true, + "hideZero": true, + "max": false, + "min": false, + "rightSide": true, + "show": false, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "span": 6, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(kube_router_service_bps_in) by (namespace, service_name, protocol, port)", + "format": "time_series", + "instant": false, + "intervalFactor": 2, + "legendFormat": "in {{namespace}}/{{service_name}} {{port}}/{{protocol}}", + "refId": "A" + }, + { + "expr": "- sum(kube_router_service_bps_out) by (namespace, service_name, protocol, port)", + "format": "time_series", + "instant": false, + "intervalFactor": 2, + "legendFormat": "out {{namespace}}/{{service_name}} {{port}}/{{protocol}}", + "refId": "B" + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "BPS", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "Bps", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ] + } + ], + "repeat": null, + "repeatIteration": null, + "repeatRowId": null, + "showTitle": false, + "title": "Dashboard Row", + "titleSize": "h6" + }, + { + "collapse": false, + "height": 281, + "panels": [ + { + "aliasColors": {}, + "bars": true, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_PROMETHEUS}", + "fill": 1, + "id": 6, + "legend": { + "alignAsTable": true, + "avg": false, + "current": true, + "hideEmpty": true, + "hideZero": true, + "max": false, + "min": false, + "rightSide": true, + "show": false, + "sort": null, + "sortDesc": null, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "span": 6, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sort_desc(sum(kube_router_service_bytes_in > 0) by (namespace, service_name, protocol, port))", + "format": "time_series", + "instant": true, + "intervalFactor": 2, + "legendFormat": "{{namespace}}
{{service_name}}
{{port}}/{{protocol}}", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Total Bytes In", + "tooltip": { + "shared": false, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "series", + "name": null, + "show": true, + "values": [ + "total" + ] + }, + "yaxes": [ + { + "format": "decbytes", + "label": null, + "logBase": 10, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": false + } + ] + }, + { + "aliasColors": {}, + "bars": true, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_PROMETHEUS}", + "fill": 1, + "id": 9, + "legend": { + "alignAsTable": true, + "avg": false, + "current": true, + "hideEmpty": false, + "hideZero": false, + "max": false, + "min": false, + "rightSide": true, + "show": false, + "sort": "current", + "sortDesc": true, + "total": false, + "values": true + }, + "lines": false, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "span": 6, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sort_desc(sum(kube_router_service_bytes_out > 0) by (namespace, service_name, protocol, port))", + "format": "time_series", + "instant": true, + "intervalFactor": 2, + "legendFormat": "{{namespace}}
{{service_name}}
{{port}}/{{protocol}}", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": "1m", + "timeShift": null, + "title": "Total Bytes Out", + "tooltip": { + "shared": false, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "series", + "name": null, + "show": true, + "values": [ + "current" + ] + }, + "yaxes": [ + { + "format": "bytes", + "label": null, + "logBase": 10, + "max": null, + "min": null, + "show": true + }, + { + "format": "bytes", + "label": null, + "logBase": 2, + "max": null, + "min": null, + "show": false + } + ] + } + ], + "repeat": null, + "repeatIteration": null, + "repeatRowId": null, + "showTitle": false, + "title": "Dashboard Row", + "titleSize": "h6" + }, + { + "collapse": false, + "height": 257, + "panels": [ + { + "aliasColors": {}, + "bars": true, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_PROMETHEUS}", + "fill": 1, + "id": 10, + "legend": { + "alignAsTable": true, + "avg": false, + "current": true, + "hideEmpty": true, + "hideZero": true, + "max": false, + "min": false, + "rightSide": true, + "show": false, + "sort": "current", + "sortDesc": true, + "total": false, + "values": true + }, + "lines": false, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "span": 6, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sort_desc(sum(kube_router_service_packets_in > 0) by (namespace, service_name, protocol, port))", + "format": "time_series", + "instant": true, + "intervalFactor": 2, + "legendFormat": "{{namespace}}
{{service_name}}
{{port}}/{{protocol}}", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Total Packets In", + "tooltip": { + "shared": false, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "series", + "name": null, + "show": true, + "values": [ + "total" + ] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 10, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": false + } + ] + }, + { + "aliasColors": {}, + "bars": true, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_PROMETHEUS}", + "fill": 1, + "id": 11, + "legend": { + "alignAsTable": true, + "avg": false, + "current": true, + "hideEmpty": true, + "hideZero": true, + "max": false, + "min": false, + "rightSide": true, + "show": false, + "sort": "current", + "sortDesc": true, + "total": false, + "values": true + }, + "lines": false, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "span": 6, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sort_desc(sum(kube_router_service_packets_out > 0) by (namespace, service_name, protocol, port))", + "format": "time_series", + "instant": true, + "intervalFactor": 2, + "legendFormat": "{{namespace}}
{{service_name}}
{{port}}/{{protocol}}", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Total Packets Out", + "tooltip": { + "shared": false, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "series", + "name": null, + "show": true, + "values": [ + "total" + ] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 10, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": false + } + ] + } + ], + "repeat": null, + "repeatIteration": null, + "repeatRowId": null, + "showTitle": false, + "title": "Dashboard Row", + "titleSize": "h6" + }, + { + "collapse": false, + "height": 250, + "panels": [ + { + "aliasColors": {}, + "bars": true, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_PROMETHEUS}", + "description": "Total connections made to the service", + "fill": 1, + "id": 12, + "legend": { + "alignAsTable": true, + "avg": false, + "current": true, + "hideEmpty": true, + "hideZero": true, + "max": false, + "min": false, + "rightSide": true, + "show": false, + "sort": "current", + "sortDesc": true, + "total": false, + "values": true + }, + "lines": false, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "span": 12, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sort_desc(sum(kube_router_service_total_connections > 0) by (namespace, service_name, protocol, port))", + "format": "time_series", + "instant": true, + "intervalFactor": 3, + "legendFormat": "{{namespace}}
{{service_name}}
{{port}}/{{protocol}}", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Total Connections", + "tooltip": { + "shared": false, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "series", + "name": null, + "show": true, + "values": [ + "total" + ] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 10, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": false + } + ] + } + ], + "repeat": null, + "repeatIteration": null, + "repeatRowId": null, + "showTitle": false, + "title": "Dashboard Row", + "titleSize": "h6" + } + ], + "schemaVersion": 14, + "style": "dark", + "tags": [ + "kube-router", + "network" + ], + "templating": { + "list": [] + }, + "time": { + "from": "now-30m", + "to": "now" + }, + "timepicker": { + "refresh_intervals": [ + "5s", + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ], + "time_options": [ + "5m", + "15m", + "1h", + "6h", + "12h", + "24h", + "2d", + "7d", + "30d" + ] + }, + "timezone": "browser", + "title": "kube-router", + "version": 27 +} \ No newline at end of file