Skip to content
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

[kube-prometheus-stack] update recording rules #39

Merged
merged 1 commit into from
Feb 1, 2024

Conversation

frezes
Copy link
Collaborator

@frezes frezes commented Jan 31, 2024

What this PR does / why we need it

Which issue this PR fixes

(optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged)

  • fixes #

Special notes for your reviewer

Checklist

  • DCO signed
  • Chart Version bumped
  • Title of the PR starts with chart name (e.g. [prometheus-couchdb-exporter])

@frezes frezes force-pushed the feat/kube-prometheus-stack branch from e3e9c6b to f227a2f Compare January 31, 2024 08:00
@frezes frezes requested a review from junotx January 31, 2024 08:19
@@ -46,7 +46,26 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
- expr: sum by (cluster, node, instance, host_ip)(node_memory_MemTotal_bytes{job="node-exporter"} -(node_memory_MemAvailable_bytes{job="node-exporter"} or (node_memory_Buffers_bytes{job="node-exporter"} + node_memory_Cached_bytes{job="node-exporter"} + node_memory_MemFree_bytes{job="node-exporter"} + node_memory_Slab_bytes{job="node-exporter"}))) * on (cluster,node) group_left(role) ((kube_node_role{job="kube-state-metrics", role="worker"} unless ignoring (role) kube_node_role{job="kube-state-metrics", role="control-plane"}) or kube_node_role{job="kube-state-metrics", role="control-plane"})
- expr: |-
sum by (cluster, node) (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's safe to remove instance, host_ip?

@@ -57,7 +76,12 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
- expr: sum by (cluster, node, instance, host_ip, role)(node_memory_MemTotal_bytes{job="node-exporter"} * on (cluster,node) group_left(role) ((kube_node_role{job="kube-state-metrics", role="worker"} unless ignoring (role) kube_node_role{job="kube-state-metrics", role="control-plane"}) or kube_node_role{job="kube-state-metrics", role="control-plane"}))
- expr: |-
sum by (cluster, node) (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

safe to remove instance, host_ip, role?

@@ -68,8 +92,8 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
- expr: node:node_filesystem_bytes_used_total:sum / node:node_filesystem_bytes_total:sum
record: node:node_filesystem_utilisation:ratio
- expr: node:node_device_filesystem_bytes_used_total:sum / node:node_device_filesystem_bytes_total:sum
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the reason of changing node:node_filesystem_bytes_ to node:node_device_filesystem_bytes_ ?

max by (cluster, node, instance, host_ip, device) (
node_filesystem_size_bytes{device=~"/dev/.*",device!~"/dev/loop\\d+", job="node-exporter"}
) * on (cluster,node) group_left(role) ((kube_node_role{job="kube-state-metrics", role="worker"} unless ignoring (role) kube_node_role{job="kube-state-metrics", role="control-plane"}) or kube_node_role{job="kube-state-metrics", role="control-plane"})
sum by (cluster, node, device) (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

again instance, host_ip are not necessary?

@@ -134,7 +214,12 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
- expr: sum by(cluster,node,host_ip,role)(kube_pod_status_scheduled{job="kube-state-metrics", condition="true"} * on(cluster,namespace,pod) group_left(node,host_ip,role) workspace_workload_node:kube_pod_info:)
- expr: |-
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

host_ip,role also removed here

@benjaminhuo benjaminhuo merged commit 2389f09 into WizTelemetry:main Feb 1, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants