Skip to content

Commit

Permalink
fix(server): correct monitor metrics promql (#1485)
Browse files Browse the repository at this point in the history
  • Loading branch information
0fatal authored Aug 23, 2023
1 parent 0c4daf6 commit 76238d7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/src/monitor/monitor.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const getQuery =
case MonitorMetric.cpuUsage:
return {
instant: false,
query: `sum(rate(container_cpu_usage_seconds_total{pod=~"${opts.pods}",namespace="${opts.namespace}"}[${rateAccuracy}])) by (${opts.selector})`,
query: `sum(rate(container_cpu_usage_seconds_total{image!="",container!="",pod=~"${opts.pods}",namespace="${opts.namespace}"}[${rateAccuracy}])) by (${opts.selector})`,
}
// case MonitorMetric.cpuRequests:
// return {
Expand All @@ -33,7 +33,7 @@ export const getQuery =
case MonitorMetric.memoryUsage:
return {
instant: false,
query: `sum(container_memory_working_set_bytes{pod=~"${opts.pods}",namespace="${opts.namespace}"}) by (${opts.selector})`,
query: `sum(container_memory_working_set_bytes{image!="",container!="",pod=~"${opts.pods}",namespace="${opts.namespace}"}) by (${opts.selector})`,
}
// case MonitorMetric.memoryRequests:
// return {
Expand Down

0 comments on commit 76238d7

Please sign in to comment.