-
Notifications
You must be signed in to change notification settings - Fork 712
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace service cpu/mem link to 'Monitor' #3060
Conversation
render/detailed/links.go
Outdated
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}}"})`, |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
render/detailed/links.go
Outdated
@@ -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}}"})`, |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
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.
9700c6a
to
23f8d40
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, hadn't noticed the new review request.
The link returned by service metrics is now built by looking up the deployment name in `report.Report` instead of assuming the service and the deployment have the same name.
@dlespiau thanks! I have added an additional commit which removes the assumption in the service metrics that the service name equals the deployment name. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe? I haven't spent any time on scope, I can believe this looks for Deployments backing up a service though :)
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.
Fixes #2925