Skip to content

Commit 10f3600

Browse files
committed
fix: cr format error
1 parent cfd2416 commit 10f3600

File tree

2 files changed

+43
-47
lines changed

2 files changed

+43
-47
lines changed
Lines changed: 26 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,30 @@
11
apiVersion: arbiter.k8s.com.cn/v1alpha1
22
kind: ObservabilityIndicant
33
metadata:
4-
name: mem-cost-example
5-
namespace: arbiter
4+
name: metric-server-node-cpu
65
spec:
7-
log: {}
8-
metric:
9-
metricIntervalSeconds: 5
10-
metrics:
11-
cpu:
12-
#query: "sum(rate($namespace))" # 这里的namespace可以被替换进去, 还是对每个pod发请求,然后拼接模板。如果发现无法正常拼接,在evetn返回错误事件。
13-
query: ""
14-
description: cpu
15-
unit: "C"
16-
aggregations:
17-
- max
18-
#type: # 变成某种类型
19-
timeRangeSeconds: 10
20-
# 最多保存多少条历史数据, 如果超过历史数据长度限制,考虑数据向前移动
21-
historyRecord: 3
22-
source: metric-server
23-
targetRef:
24-
group: ""
25-
version: "v1"
26-
resources: pods
27-
namespace: arbiter
28-
name: mem-cost-78ccff7d6b-vbm7n
29-
labels:
30-
aa: bb
31-
# labels:
32-
# app: app
33-
# node 放到annotations可以考虑。
34-
# 通过标签查询,后面介入的不管是链路,合作和其他的,都是传递标签直接使用
35-
# 通过label的情况,需要保证这里的label与obi的label一致。也许不需要
36-
trace: {}
6+
metric:
7+
historyLimit: 1
8+
metricIntervalSeconds: 30
9+
metrics:
10+
cpu:
11+
aggregations:
12+
- time
13+
description: ""
14+
query: ""
15+
unit: 'm'
16+
timeRangeSeconds: 3600
17+
source: metric-server
18+
targetRef:
19+
group: ""
20+
index: 0
21+
kind: Node
22+
labels:
23+
"data-test": "data-test"
24+
name: ""
25+
namespace: ""
26+
version: v1
27+
status:
28+
conditions: []
29+
phase: ""
30+
metrics: {}
Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,29 @@
11
apiVersion: arbiter.k8s.com.cn/v1alpha1
22
kind: ObservabilityIndicant
33
metadata:
4-
name: mem-cost-example-prometheus
5-
namespace: arbiter
4+
name: prometheus-node-cpu
65
spec:
7-
log: {}
86
metric:
9-
metricIntervalSeconds: 5
7+
historyLimit: 1
8+
metricIntervalSeconds: 30
109
metrics:
1110
cpu:
12-
query: "sum(rate(container_cpu_usage_seconds_total{pod=\"mem-cost-78ccff7d6b-vbm7n\", namespace=\"arbiter\",container!=\"\",container!=\"POD\"}[2m]))"
13-
description: "cpu"
14-
unit: "C"
15-
aggregations: []
11+
aggregations: [ ]
12+
description: cpu
13+
query: (sum(count(node_cpu_seconds_total{mode="idle",node="{{.metadata.name}}"}) by (mode, cpu)) - sum(irate(node_cpu_seconds_total{mode="idle",node="{{.metadata.name}}"}[5m])))*1000
14+
unit: 'm'
1615
timeRangeSeconds: 3600
17-
historyRecord: 3
1816
source: prometheus
1917
targetRef:
2018
group: ""
21-
version: "v1"
22-
resources: pods
23-
namespace: arbiter
24-
name: mem-cost-78ccff7d6b-vbm7n
19+
index: 0
20+
kind: Node
2521
labels:
26-
aa: bb
27-
trace: {}
22+
"data-test": "data-test"
23+
name: ""
24+
namespace: ""
25+
version: v1
26+
status:
27+
conditions: []
28+
phase: ""
29+
metrics: {}

0 commit comments

Comments
 (0)