Skip to content

Commit

Permalink
Display OVN metrics from worker node (#134)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
venkataanil authored Sep 24, 2024
1 parent c504fc1 commit 3fc75cc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions assets/kube-burner-report-ocp-wrapper/queries.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -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.*/'),
],
},
Expand Down Expand Up @@ -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.*/'),
],
},
Expand Down Expand Up @@ -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.*/'),
],
},
Expand All @@ -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: {
Expand Down
4 changes: 2 additions & 2 deletions templates/CPT/kube-burner-report-ocp-wrapper.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -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 })
Expand Down

0 comments on commit 3fc75cc

Please sign in to comment.