Skip to content

Commit

Permalink
Replace service cpu/mem link to 'Monitor'
Browse files Browse the repository at this point in the history
The previous link to 'Monitor' contained a recording rule metric, and since not all Weave Clound instances have recording rules, the link would redirect to a 'Monitor' page without data points.
The recording rule metric has been substituted with the underlying query.
  • Loading branch information
Roberto Bruggemann committed Feb 6, 2018
1 parent 8ac4811 commit 9700c6a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions render/detailed/links.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ var (
// NB: Pods need to be labeled and selected by their respective Service name, meaning:
// - The Service's `spec.selector` needs to select on `name`
// - The Service's `metadata.name` needs to be the same value as `spec.selector.name`
docker.CPUTotalUsage: `namespace_label_name:container_cpu_usage_seconds_total:sum_rate{label_name="{{label}}",namespace="{{namespace}}"}`,
docker.MemoryUsage: `namespace_label_name:container_memory_usage_bytes:sum{label_name="{{label}}",namespace="{{namespace}}"}`,
docker.CPUTotalUsage: `sum(label_replace(sum(rate(container_cpu_usage_seconds_total{image!="",namespace="{{namespace}}"}[5m])) by (pod_name, namespace), "pod", "$1", "pod_name", "(.*)") * on (pod) group_right(pod_name) kube_pod_labels{_weave_namespace="weave",_weave_service="kube-state-metrics",label_name="{{label}}"})`,
docker.MemoryUsage: `sum(label_replace(sum(container_memory_usage_bytes{image!="",namespace="{{namespace}}"}) by (pod_name, namespace), "pod", "$1", "pod_name", "(.*)") * on (pod) group_right(pod_name) kube_pod_labels{_weave_namespace="weave",_weave_service="kube-state-metrics",label_name="{{label}}"})`,
},
}
)
Expand Down

0 comments on commit 9700c6a

Please sign in to comment.