Skip to content

Commit 39a3131

Browse files
Signed-off-by: Kushal Shukla <[email protected]>
1. Added rules in prombench As a Config Map. 2. removed some queries from load-generator and added on rules 3. rename fakewebserver file
1 parent 51b2051 commit 39a3131

File tree

5 files changed

+46
-7
lines changed

5 files changed

+46
-7
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: prometheus-rules
5+
namespace: prombench-{{ .PR_NUMBER }}
6+
data:
7+
rules.yml: |
8+
groups:
9+
- name: recording_rules
10+
interval: 15s
11+
rules:
12+
- record: instance:codelab_api_requests:rate5m
13+
expr: sum by(instance) (rate(codelab_api_requests_total{method=~"GET|POST"}[5m]))
14+
15+
- record: instance:node_cpu_usage:rate5m
16+
expr: sum by(instance) (rate(node_cpu_seconds_total{mode!="idle"}[5m]))
17+
18+
- record: instance:codelab_api_request_duration:quantile_99
19+
expr: histogram_quantile(0.99, sum by(instance, le) (rate(codelab_api_request_duration_seconds_bucket{method="POST"}[5m])))
20+
21+
- record: instance:codelab_api_request_duration_seconds_count:filtered
22+
expr: codelab_api_request_duration_seconds_count{method="POST"} unless codelab_api_request_duration_seconds_count{status="500"}
23+
24+
- record: instance:codelab_api_request_duration_seconds_count:top10
25+
expr: topk(10, sum(codelab_api_request_duration_seconds_count) by (method, job))

prombench/manifests/prombench/benchmark/3_prometheus-test-pr_deployment.yaml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ data:
77
prometheus.yml: |
88
global:
99
scrape_interval: 15s
10-
10+
evaluation_interval: 15s
11+
12+
rule_files:
13+
- "/etc/prometheus/rules/rules.yml"
14+
1115
scrape_configs:
1216
- job_name: kubelets
1317
scheme: https
@@ -805,6 +809,8 @@ spec:
805809
mountPath: /prometheus
806810
- name: prometheus-executable
807811
mountPath: /usr/bin
812+
- name: prometheus-rules
813+
mountPath: /etc/prometheus/rules
808814
ports:
809815
- name: prom-web
810816
containerPort: 9090
@@ -818,6 +824,9 @@ spec:
818824
path: /mnt/disks/ssd0
819825
- name: prometheus-executable
820826
emptyDir: {}
827+
- name: prometheus-rules
828+
configMap:
829+
name: prometheus-rules
821830
terminationGracePeriodSeconds: 300
822831
nodeSelector:
823832
node-name: prometheus-{{ .PR_NUMBER }}

prombench/manifests/prombench/benchmark/3_prometheus-test-release_deployment.yaml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ data:
77
prometheus.yml: |
88
global:
99
scrape_interval: 15s
10-
10+
evaluation_interval: 15s
11+
12+
rule_files:
13+
- "/etc/prometheus/rules/rules.yml"
14+
1115
scrape_configs:
1216
- job_name: kubelets
1317
scheme: https
@@ -777,6 +781,8 @@ spec:
777781
mountPath: /etc/prometheus
778782
- name: instance-ssd
779783
mountPath: /prometheus
784+
- name: prometheus-rules
785+
mountPath: /etc/prometheus/rules
780786
ports:
781787
- name: prom-web
782788
containerPort: 9090
@@ -788,6 +794,9 @@ spec:
788794
hostPath:
789795
# /mnt is where GKE keeps it's SSD.
790796
path: /mnt/disks/ssd0
797+
- name: prometheus-rules
798+
configMap:
799+
name: prometheus-rules
791800
terminationGracePeriodSeconds: 300
792801
nodeSelector:
793802
node-name: prometheus-{{ .PR_NUMBER }}

prombench/manifests/prombench/benchmark/6_loadgen.yaml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ data:
2727
- expr: sum by(instance) (rate(node_cpu_seconds_total{mode!="idle"}[5m]))
2828
- expr: sum by(instance) (rate(node_cpu_seconds_total[5m]))
2929
- expr: sum by(instance) (rate(codelab_api_requests_total[5m]))
30-
- expr: sum by(instance) (rate(codelab_api_requests_total{method=~"GET|POST"}[5m]))
3130
- name: aggr_range
3231
interval: 30s
3332
type: range
@@ -36,7 +35,6 @@ data:
3635
step: 15s
3736
queries:
3837
- expr: sum by(image) (container_memory_rss)
39-
- expr: sum by(instance) (rate(node_cpu_seconds_total{mode!="idle"}[5m]))
4038
- expr: sum by(instance) (rate(node_cpu_seconds_total[5m]))
4139
- expr: sum by(instance) (rate(codelab_api_requests_total[5m]))
4240
- expr: sum by(instance) (rate(codelab_api_requests_total{method=~"GET|POST"}[5m]))
@@ -53,20 +51,18 @@ data:
5351
queries:
5452
- expr: rate(go_memstats_frees_total[5m]) * 60
5553
- expr: rate(codelab_api_requests_total{method=~"GET|POST"}[5m]) - rate(codelab_api_request_duration_seconds_sum{method=~"GET|POST"}[5m])
56-
- expr: rate(go_gc_duration_seconds_sum{job=~"fake-webservers-[0-9]+"}[5m]) / rate(go_gc_duration_seconds_count{job=~"fake-webservers-[0-9]+"}[5m])
54+
- expr: rate(go_gc_duration_seconds_sum{job=~"fake-webservers-[0-9]+"}[5m]) / rate(go_gc_duration_seconds_count{job=~"fake-webservers-[0-9]+"}[5m])
5755
- expr: sum by (instance, job) (rate(codelab_api_request_errors_total[5m])) / sum by (instance, job) (rate(go_memstats_mallocs_total[10m]))
5856
- name: logic_operator
5957
interval: 30s
6058
type: instant
6159
queries:
6260
- expr: codelab_api_request_duration_seconds_sum{status="200"} or codelab_api_request_duration_seconds_sum{status="500"}
63-
- expr: codelab_api_request_duration_seconds_count{method="POST"} unless codelab_api_request_duration_seconds_count{status="500"}
6461
- name: topk
6562
interval: 10s
6663
type: instant
6764
queries:
6865
- expr: topk(20, sum(rate(go_gc_duration_seconds_count[5m])) by (instance, job))
69-
- expr: topk(10, sum(codelab_api_request_duration_seconds_count) by (method,job))
7066
---
7167
apiVersion: apps/v1
7268
kind: Deployment

0 commit comments

Comments
 (0)