Skip to content

Commit

Permalink
Add vm prometheus metrics (#756)
Browse files Browse the repository at this point in the history
  • Loading branch information
ebattat authored Jan 10, 2024
1 parent f7f2a3d commit 0f5d63a
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 5 deletions.
37 changes: 35 additions & 2 deletions benchmark_runner/common/prometheus/metrics-default.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


# container CPU/Memory

- query: (sum(irate(container_cpu_usage_seconds_total{container!="",namespace="benchmark-runner", mode!="idle"}[2m])) by (node)) > 0
Expand All @@ -17,3 +15,38 @@
- query: container_memory_max_usage_bytes{pod=~"virt-launcher.*", container="compute"}
metricName: VM Memory Max Usage Bytes

- query: container_memory_cache{container=~"virt-handler", namespace="openshift-cnv"}
metricName: virt handler Cache

- query: container_memory_working_set_bytes{container=~"virt-handler", namespace="openshift-cnv"}
metricName: virt handler working set bytes

- query: container_memory_cache{container=~"virt-controller", namespace="openshift-cnv"}
metricName: virt controller Cache

- query: container_memory_working_set_bytes{container=~"virt-controller", namespace="openshift-cnv"}
metricName: virt controller working set bytes

- query: container_memory_cache{container=~"virt-operator", namespace="openshift-cnv"}
metricName: virt operator Cache

- query: container_memory_working_set_bytes{container=~"virt-operator", namespace="openshift-cnv"}
metricName: virt operator working set bytes

- query: container_memory_cache{container=~"virt-api", namespace="openshift-cnv"}
metricName: virt api Cache

- query: container_memory_working_set_bytes{container=~"virt-api", namespace="openshift-cnv"}
metricName: virt api working set bytes

- query: min ((kube_pod_container_resource_requests{namespace="openshift-cnv",container=~"virt-handler",resource="memory"}) - on(pod) group_left(node) container_memory_working_set_bytes{container="",namespace="openshift-cnv"})
metricName: virt handler exceeds requested memory

- query: min ((kube_pod_container_resource_requests{namespace="openshift-cnv",container=~"virt-controller",resource="memory"}) - on(pod) group_left(node) container_memory_working_set_bytes{container="",namespace="openshift-cnv"})
metricName: virt controller exceeds requested memory

- query: min ((kube_pod_container_resource_requests{namespace="openshift-cnv",container=~"virt-operator",resource="memory"}) - on(pod) group_left(node) container_memory_working_set_bytes{container="",namespace="openshift-cnv"})
metricName: virt operator exceeds requested memory

- query: min ((kube_pod_container_resource_requests{namespace="openshift-cnv",container=~"virt-api",resource="memory"}) - on(pod) group_left(node) container_memory_working_set_bytes{container="",namespace="openshift-cnv"})
metricName: virt api exceeds requested memory
Original file line number Diff line number Diff line change
Expand Up @@ -180,15 +180,15 @@ def parse_prometheus_metrics(data: dict):
elif 'containerMemory-benchmark-runner' in query:
suffix = 'Memory'
else:
suffix = ''
suffix = None
total = 0
max = 0
for item in data_list:
for val in item['values']:
if float(val[1]) > max:
max = round(float(val[1]), 3)
total = total + max
if 'VM Memory' in query:
if not suffix:
result_dict[f'{query}'] = max
else:
result_dict[f"{item['metric']['node']}_{suffix}"] = max
Expand Down
2 changes: 1 addition & 1 deletion benchmark_runner/grafana/perf/jsonnet/main.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -5570,7 +5570,7 @@ g.dashboard.new('PerfCI-Regression-Summary')
]),
////////////////////////

g.panel.stateTimeline.new('120 Windows VM Memory')
g.panel.stateTimeline.new('111 Windows VM Memory')
+ stateTimeline.queryOptions.withDatasource('Elasticsearch-windows-results')
+ g.panel.stateTimeline.withDescription('Time till VM Login - Lower is better')

Expand Down

0 comments on commit 0f5d63a

Please sign in to comment.