From 982f44c300ef1f561a83c103a4ac8d91453d5642 Mon Sep 17 00:00:00 2001 From: venkataanil Date: Tue, 10 Sep 2024 13:05:12 +0000 Subject: [PATCH] Display OVN metrics from worker node Prometheus query metric containerCPU-AggregatedWorkers is NOT using the pod while fetching the data, so fixed that in the worker panel. ovnkube-master pod names is replaced with ovnkube-node pod from 4.14. Signed-off-by: venkataanil --- .../queries.libsonnet | 14 +++++++------- .../CPT/kube-burner-report-ocp-wrapper.jsonnet | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/assets/kube-burner-report-ocp-wrapper/queries.libsonnet b/assets/kube-burner-report-ocp-wrapper/queries.libsonnet index 95db446..a85e9f8 100644 --- a/assets/kube-burner-report-ocp-wrapper/queries.libsonnet +++ b/assets/kube-burner-report-ocp-wrapper/queries.libsonnet @@ -579,7 +579,7 @@ local elasticsearch = g.query.elasticsearch; + elasticsearch.withQuery(query) + elasticsearch.withTimeField('timestamp'), queries(metric): [ - self.base('{{labels.pod.keyword}}', 'uuid.keyword: $uuid AND metricName: "' + metric + '" AND labels.pod.keyword: /ovnkube-master.*/'), + self.base('{{labels.pod.keyword}}', 'uuid.keyword: $uuid AND metricName: "' + metric + '" AND labels.pod.keyword: /ovnkube-node.*/'), self.base('{{labels.pod.keyword}}', 'uuid.keyword: $uuid AND metricName: "' + metric + '" AND labels.pod.keyword: /ovnkube-control-plane.*/'), ], }, @@ -617,7 +617,7 @@ local elasticsearch = g.query.elasticsearch; + elasticsearch.withQuery(query) + elasticsearch.withTimeField('timestamp'), queries(metric): [ - self.base('{{labels.pod.keyword}}-{{labels.container.keyword}}', 'uuid.keyword: $uuid AND metricName: "' + metric + '" AND labels.pod.keyword: /ovnkube-master.*/'), + self.base('{{labels.pod.keyword}}-{{labels.container.keyword}}', 'uuid.keyword: $uuid AND metricName: "' + metric + '" AND labels.pod.keyword: /ovnkube-node.*/'), self.base('{{labels.pod.keyword}}-{{labels.container.keyword}}', 'uuid.keyword: $uuid AND metricName: "' + metric + '" AND labels.pod.keyword: /ovnkube-control-plane.*/'), ], }, @@ -722,7 +722,7 @@ local elasticsearch = g.query.elasticsearch; + elasticsearch.withQuery(query) + elasticsearch.withTimeField('timestamp'), queries(metric): [ - self.base('', 'uuid.keyword: $uuid AND metricName: "' + metric + '" AND labels.pod.keyword: /ovnkube-master.*/'), + self.base('', 'uuid.keyword: $uuid AND metricName: "' + metric + '" AND labels.pod.keyword: /ovnkube-node.*/'), self.base('', 'uuid.keyword: $uuid AND metricName: "' + metric + '" AND labels.pod.keyword: /ovnkube-control-plane.*/'), ], }, @@ -746,11 +746,11 @@ local elasticsearch = g.query.elasticsearch; + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges('0'), ]) + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Sum.withField('value') - + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withId('1') - + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withType('sum'), + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), ]) - + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName: "' + metric + '" AND labels.namespace.keyword: "openshift-ovn-kubernetes" AND labels.pod.keyword: /ovnkube-node.*/') + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName: "' + metric + '" AND labels.namespace.keyword: "openshift-ovn-kubernetes" ') + elasticsearch.withTimeField('timestamp'), }, etcd99thLatencies: { diff --git a/templates/CPT/kube-burner-report-ocp-wrapper.jsonnet b/templates/CPT/kube-burner-report-ocp-wrapper.jsonnet index 4ced8f0..15f766e 100644 --- a/templates/CPT/kube-burner-report-ocp-wrapper.jsonnet +++ b/templates/CPT/kube-burner-report-ocp-wrapper.jsonnet @@ -73,8 +73,8 @@ g.dashboard.new('Kube-burner Report - OCP wrapper') panels.timeSeries.sortByMax('ovn-controller Memory Usage', 'bytes', queries.ovnControllerStats.query('containerMemory'), { x: 12, y: 41, w: 12, h: 8 }, null), panels.timeSeries.withMeanMax('Aggregated OVNKube-master containers CPU', 'percent', queries.aggregatedOVNKubeMasterStats.queries('containerCPU'), { x: 0, y: 49, w: 12, h: 14 }, null), panels.timeSeries.withMeanMax('Aggregated OVNKube-master containers memory', 'bytes', queries.aggregatedOVNKubeMasterStats.queries('containerMemory'), { x: 12, y: 49, w: 12, h: 14 }, null), - panels.timeSeries.withMeanMax('Aggregated OVNKube-node containers CPU', 'percent', queries.aggregatedOVNKubeNodeStats.query('containerCPU'), { x: 0, y: 63, w: 12, h: 14 }, null), - panels.timeSeries.sortByMeanCommon('Aggregated OVNKube-node containers Memory', 'bytes', queries.aggregatedOVNKubeNodeStats.query('containerMemory'), { x: 12, y: 63, w: 12, h: 14 }, null), + panels.timeSeries.withMeanMax('Aggregated OVNKube-node containers CPU', 'percent', queries.aggregatedOVNKubeNodeStats.query('containerCPU-AggregatedWorkers'), { x: 0, y: 63, w: 12, h: 14 }, null), + panels.timeSeries.sortByMeanCommon('Aggregated OVNKube-node containers Memory', 'bytes', queries.aggregatedOVNKubeNodeStats.query('containerMemory-AggregatedWorkers'), { x: 12, y: 63, w: 12, h: 14 }, null), ]), g.panel.row.new('etcd') + g.panel.row.withGridPos({ x: 0, y: 14, w: 24, h: 1 })