forked from prometheus-community/helm-charts
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #48 from junotx/rules
fix scheduler scheduling latency rules to compatible with new metrics
- Loading branch information
Showing
6 changed files
with
193 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
121 changes: 121 additions & 0 deletions
121
...metheus-stack/templates/prometheus/rules-1.14/whizard-telemetry-kube-scheduler.rules.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
{{- /* | ||
Generated from 'whizard-telemetry-kube-scheduler.rules' group from file://../../../ks-prometheus/manifests/whizard-telemetry-prometheusRule.yaml | ||
Do not change in-place! In order to change this file first read following link: | ||
https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack/hack | ||
*/ -}} | ||
{{- $kubeTargetVersion := default .Capabilities.KubeVersion.GitVersion .Values.kubeTargetVersionOverride }} | ||
{{- if and (semverCompare ">=1.14.0-0" $kubeTargetVersion) (semverCompare "<9.9.9-9" $kubeTargetVersion) .Values.defaultRules.create .Values.defaultRules.rules.whizardTelemetry }} | ||
apiVersion: monitoring.coreos.com/v1 | ||
kind: PrometheusRule | ||
metadata: | ||
name: {{ printf "%s-%s" (include "kube-prometheus-stack.fullname" .) "whizard-telemetry-kube-scheduler.rules" | trunc 63 | trimSuffix "-" }} | ||
namespace: {{ template "kube-prometheus-stack.namespace" . }} | ||
labels: | ||
app: {{ template "kube-prometheus-stack.name" . }} | ||
{{ include "kube-prometheus-stack.labels" . | indent 4 }} | ||
{{- if .Values.defaultRules.labels }} | ||
{{ toYaml .Values.defaultRules.labels | indent 4 }} | ||
{{- end }} | ||
{{- if .Values.defaultRules.annotations }} | ||
annotations: | ||
{{ toYaml .Values.defaultRules.annotations | indent 4 }} | ||
{{- end }} | ||
spec: | ||
groups: | ||
- name: whizard-telemetry-kube-scheduler.rules | ||
rules: | ||
- expr: histogram_quantile(0.99, sum(rate(scheduler_e2e_scheduling_duration_seconds_bucket{job="kube-scheduler"}[5m])) without(instance, pod, result)) | ||
labels: | ||
quantile: '0.99' | ||
{{- if or .Values.defaultRules.additionalRuleLabels .Values.defaultRules.additionalRuleGroupLabels.whizardTelemetry }} | ||
{{- with .Values.defaultRules.additionalRuleLabels }} | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.defaultRules.additionalRuleGroupLabels.whizardTelemetry }} | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- end }} | ||
record: cluster_quantile:scheduler_e2e_scheduling_duration_seconds:histogram_quantile | ||
- expr: histogram_quantile(0.99, sum(rate(scheduler_scheduling_attempt_duration_seconds_bucket{job="kube-scheduler"}[5m])) without(instance, pod, result)) | ||
labels: | ||
quantile: '0.99' | ||
{{- if or .Values.defaultRules.additionalRuleLabels .Values.defaultRules.additionalRuleGroupLabels.whizardTelemetry }} | ||
{{- with .Values.defaultRules.additionalRuleLabels }} | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.defaultRules.additionalRuleGroupLabels.whizardTelemetry }} | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- end }} | ||
record: cluster_quantile:scheduler_scheduling_attempt_duration_seconds:histogram_quantile | ||
- expr: histogram_quantile(0.9, sum(rate(scheduler_e2e_scheduling_duration_seconds_bucket{job="kube-scheduler"}[5m])) without(instance, pod, result)) | ||
labels: | ||
quantile: '0.9' | ||
{{- if or .Values.defaultRules.additionalRuleLabels .Values.defaultRules.additionalRuleGroupLabels.whizardTelemetry }} | ||
{{- with .Values.defaultRules.additionalRuleLabels }} | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.defaultRules.additionalRuleGroupLabels.whizardTelemetry }} | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- end }} | ||
record: cluster_quantile:scheduler_e2e_scheduling_duration_seconds:histogram_quantile | ||
- expr: histogram_quantile(0.9, sum(rate(scheduler_scheduling_attempt_duration_seconds_bucket{job="kube-scheduler"}[5m])) without(instance, pod, result)) | ||
labels: | ||
quantile: '0.9' | ||
{{- if or .Values.defaultRules.additionalRuleLabels .Values.defaultRules.additionalRuleGroupLabels.whizardTelemetry }} | ||
{{- with .Values.defaultRules.additionalRuleLabels }} | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.defaultRules.additionalRuleGroupLabels.whizardTelemetry }} | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- end }} | ||
record: cluster_quantile:scheduler_scheduling_attempt_duration_seconds:histogram_quantile | ||
- expr: histogram_quantile(0.5, sum(rate(scheduler_e2e_scheduling_duration_seconds_bucket{job="kube-scheduler"}[5m])) without(instance, pod, result)) | ||
labels: | ||
quantile: '0.5' | ||
{{- if or .Values.defaultRules.additionalRuleLabels .Values.defaultRules.additionalRuleGroupLabels.whizardTelemetry }} | ||
{{- with .Values.defaultRules.additionalRuleLabels }} | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.defaultRules.additionalRuleGroupLabels.whizardTelemetry }} | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- end }} | ||
record: cluster_quantile:scheduler_e2e_scheduling_duration_seconds:histogram_quantile | ||
- expr: histogram_quantile(0.5, sum(rate(scheduler_scheduling_attempt_duration_seconds_bucket{job="kube-scheduler"}[5m])) without(instance, pod, result)) | ||
labels: | ||
quantile: '0.5' | ||
{{- if or .Values.defaultRules.additionalRuleLabels .Values.defaultRules.additionalRuleGroupLabels.whizardTelemetry }} | ||
{{- with .Values.defaultRules.additionalRuleLabels }} | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.defaultRules.additionalRuleGroupLabels.whizardTelemetry }} | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- end }} | ||
record: cluster_quantile:scheduler_scheduling_attempt_duration_seconds:histogram_quantile | ||
- expr: sum by(cluster) (rate(scheduler_e2e_scheduling_duration_seconds_sum{job="kube-scheduler"}[5m])) / sum by(cluster) (rate(scheduler_e2e_scheduling_duration_seconds_count{job="kube-scheduler"}[5m])) | ||
record: cluster:scheduler_e2e_scheduling_duration_seconds:avg | ||
{{- if or .Values.defaultRules.additionalRuleLabels .Values.defaultRules.additionalRuleGroupLabels.whizardTelemetry }} | ||
labels: | ||
{{- with .Values.defaultRules.additionalRuleLabels }} | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.defaultRules.additionalRuleGroupLabels.whizardTelemetry }} | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- end }} | ||
- expr: sum by(cluster) (rate(scheduler_scheduling_attempt_duration_seconds_sum{job="kube-scheduler"}[5m])) / sum by(cluster) (rate(scheduler_scheduling_attempt_duration_seconds_count{job="kube-scheduler"}[5m])) | ||
record: cluster:scheduler_scheduling_attempt_duration_seconds:avg | ||
{{- if or .Values.defaultRules.additionalRuleLabels .Values.defaultRules.additionalRuleGroupLabels.whizardTelemetry }} | ||
labels: | ||
{{- with .Values.defaultRules.additionalRuleLabels }} | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.defaultRules.additionalRuleGroupLabels.whizardTelemetry }} | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters