Skip to content

Commit b9c4f5d

Browse files
authored
Merge pull request #52 from xyctruth/develop
The default trace analysis is turned off
2 parents ff2b5a5 + 8a67a27 commit b9c4f5d

File tree

6 files changed

+101
-16
lines changed

6 files changed

+101
-16
lines changed

README-EN.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ collector:
133133

134134
default configuration of `profileConfigs`
135135

136+
The default trace analysis is turned off, because the trace file is too large, about (500KB ~ 2M), you need to open the trace analysis in the `collector.yaml` setting to override the default trace configuration.
137+
136138
```yaml
137139
profileConfigs:
138140
profile:
@@ -141,9 +143,6 @@ profileConfigs:
141143
fgprof:
142144
path: /debug/fgprof?seconds=10
143145
enable: true
144-
trace:
145-
path: /debug/pprof/trace?seconds=10
146-
enable: true
147146
mutex:
148147
path: /debug/pprof/mutex
149148
enable: true
@@ -162,4 +161,7 @@ profileConfigs:
162161
threadcreate:
163162
path: /debug/pprof/threadcreate
164163
enable: true
164+
trace:
165+
path: /debug/pprof/trace?seconds=10
166+
enable: false
165167
```

README-ZH.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ collector:
133133

134134
`profileConfigs` 默认配置
135135

136+
默认 trace 分析关闭, 因为 trace 文件过大,大约在(500KB ~ 2M), 需要开启 trace 分析在 `collector.yaml` 设置覆盖默认的 trace 配置.
137+
136138
```yaml
137139
profileConfigs:
138140
profile:
@@ -141,9 +143,6 @@ profileConfigs:
141143
fgprof:
142144
path: /debug/fgprof?seconds=10
143145
enable: true
144-
trace:
145-
path: /debug/pprof/trace?seconds=10
146-
enable: true
147146
mutex:
148147
path: /debug/pprof/mutex
149148
enable: true
@@ -162,4 +161,7 @@ profileConfigs:
162161
threadcreate:
163162
path: /debug/pprof/threadcreate
164163
enable: true
164+
trace:
165+
path: /debug/pprof/trace?seconds=10
166+
enable: false
165167
```

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ collector:
133133

134134
`profileConfigs` 默认配置
135135

136+
默认 trace 分析关闭, 因为 trace 文件过大,大约在(500KB ~ 2M), 需要开启 trace 分析在 `collector.yaml` 设置覆盖默认的 trace 配置.
137+
136138
```yaml
137139
profileConfigs:
138140
profile:
@@ -141,9 +143,6 @@ profileConfigs:
141143
fgprof:
142144
path: /debug/fgprof?seconds=10
143145
enable: true
144-
trace:
145-
path: /debug/pprof/trace?seconds=10
146-
enable: true
147146
mutex:
148147
path: /debug/pprof/mutex
149148
enable: true
@@ -162,4 +161,7 @@ profileConfigs:
162161
threadcreate:
163162
path: /debug/pprof/threadcreate
164163
enable: true
164+
trace:
165+
path: /debug/pprof/trace?seconds=10
166+
enable: false
165167
```

charts/profiler/values.dev.yaml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ configuration: |-
1111
interval: 5m
1212
expiration: 168h
1313
host: localhost:9000
14+
profileConfigs:
15+
trace:
16+
enable: true
1417
labels:
1518
namespace: profiler-system
1619
type: system
@@ -20,34 +23,49 @@ configuration: |-
2023
interval: 5m
2124
expiration: 168h
2225
host: admin-gateway.prod-green:9000
26+
profileConfigs:
27+
trace:
28+
enable: true
2329
labels:
2430
namespace: prod-green
2531
type: gateway
2632
app-businesses-gateway-prod-green:
2733
interval: 5m
2834
expiration: 168h
2935
host: app-businesses-gateway.prod-green:9000
36+
profileConfigs:
37+
trace:
38+
enable: true
3039
labels:
3140
namespace: prod-green
3241
type: gateway
3342
app-gateway-prod-green:
3443
interval: 5m
3544
expiration: 168h
3645
host: app-gateway.prod-green:9000
46+
profileConfigs:
47+
trace:
48+
enable: true
3749
labels:
3850
namespace: prod-green
3951
type: gateway
4052
app-gymnasiums-gateway-prod-green:
4153
interval: 5m
4254
expiration: 168h
4355
host: app-gymnasiums-gateway.prod-green:9000
56+
profileConfigs:
57+
trace:
58+
enable: true
4459
labels:
4560
namespace: prod-green
4661
type: gateway
4762
app-supplychain-gateway-prod-green:
4863
interval: 5m
4964
expiration: 168h
5065
host: app-supplychain-gateway.prod-green:9000
66+
profileConfigs:
67+
trace:
68+
enable: true
5169
labels:
5270
namespace: prod-green
5371
type: gateway
@@ -57,146 +75,209 @@ configuration: |-
5775
interval: 5m
5876
expiration: 168h
5977
host: app-awards-svc.prod-green:9000
78+
profileConfigs:
79+
trace:
80+
enable: true
6081
labels:
6182
namespace: prod-green
6283
type: svc
6384
app-businesses-b-svc-prod-green:
6485
interval: 5m
6586
expiration: 168h
6687
host: app-businesses-b-svc.prod-green:9000
88+
profileConfigs:
89+
trace:
90+
enable: true
6791
labels:
6892
namespace: prod-green
6993
type: svc
7094
app-channel-b-svc-prod-green:
7195
interval: 5m
7296
expiration: 168h
7397
host: app-channel-b-svc.prod-green:9000
98+
profileConfigs:
99+
trace:
100+
enable: true
74101
labels:
75102
namespace: prod-green
76103
type: svc
77104
app-coupon-b-svc-prod-green:
78105
interval: 5m
79106
expiration: 168h
80107
host: app-coupon-b-svc.prod-green:9000
108+
profileConfigs:
109+
trace:
110+
enable: true
81111
labels:
82112
namespace: prod-green
83113
type: svc
84114
app-coupon-c-svc-prod-green:
85115
interval: 5m
86116
expiration: 168h
87117
host: app-coupon-c-svc.prod-green:9000
118+
profileConfigs:
119+
trace:
120+
enable: true
88121
labels:
89122
namespace: prod-green
90123
type: svc
91124
app-fitness-b-svc-prod-green:
92125
interval: 5m
93126
expiration: 168h
94127
host: app-fitness-b-svc.prod-green:9000
128+
profileConfigs:
129+
trace:
130+
enable: true
95131
labels:
96132
namespace: prod-green
97133
type: svc
98134
app-fitness-c-svc-prod-green:
99135
interval: 5m
100136
expiration: 168h
101137
host: app-fitness-c-svc.prod-green:9000
138+
profileConfigs:
139+
trace:
140+
enable: true
102141
labels:
103142
namespace: prod-green
104143
type: svc
105144
app-gymnasiums-b-svc-prod-green:
106145
interval: 5m
107146
expiration: 168h
108147
host: app-gymnasiums-b-svc.prod-green:9000
148+
profileConfigs:
149+
trace:
150+
enable: true
109151
labels:
110152
namespace: prod-green
111153
type: svc
112154
app-knowledge-svc:
113155
interval: 5m
114156
expiration: 168h
115157
host: app-knowledge-svc.prod-green:9000
158+
profileConfigs:
159+
trace:
160+
enable: true
116161
labels:
117162
namespace: prod-green
118163
type: svc
119164
app-lotteries-svc-prod-green:
120165
interval: 5m
121166
expiration: 168h
122167
host: app-lotteries-svc.prod-green:9000
168+
profileConfigs:
169+
trace:
170+
enable: true
123171
labels:
124172
namespace: prod-green
125173
type: svc
126174
app-media-c-svc-prod-green:
127175
interval: 5m
128176
expiration: 168h
129177
host: app-media-c-svc.prod-green:9000
178+
profileConfigs:
179+
trace:
180+
enable: true
130181
labels:
131182
namespace: prod-green
132183
type: svc
133184
app-media-m-svc-prod-green:
134185
interval: 5m
135186
expiration: 168h
136187
host: app-media-m-svc.prod-green:9000
188+
profileConfigs:
189+
trace:
190+
enable: true
137191
labels:
138192
namespace: prod-green
139193
type: svc
140194
app-split-svc-prod-green:
141195
interval: 5m
142196
expiration: 168h
143197
host: app-split-svc.prod-green:9000
198+
profileConfigs:
199+
trace:
200+
enable: true
144201
labels:
145202
namespace: prod-green
146203
type: svc
147204
app-supplychain-b-svc-prod-green:
148205
interval: 5m
149206
expiration: 168h
150207
host: app-supplychain-b-svc.prod-green:9000
208+
profileConfigs:
209+
trace:
210+
enable: true
151211
labels:
152212
namespace: prod-green
153213
type: svc
154214
app-supplychain-c-svc-prod-green:
155215
interval: 5m
156216
expiration: 168h
157217
host: app-supplychain-c-svc.prod-green:9000
218+
profileConfigs:
219+
trace:
220+
enable: true
158221
labels:
159222
namespace: prod-green
160223
type: svc
161224
app-vip-svc-prod-green:
162225
interval: 5m
163226
expiration: 168h
164227
host: app-vip-svc.prod-green:9000
228+
profileConfigs:
229+
trace:
230+
enable: true
165231
labels:
166232
namespace: prod-green
167233
type: svc
168234
basic-common-svc-prod-green:
169235
interval: 5m
170236
expiration: 168h
171237
host: basic-common-svc.prod-green:9000
238+
profileConfigs:
239+
trace:
240+
enable: true
172241
labels:
173242
namespace: prod-green
174243
type: svc
175244
basic-notification-svc-prod-green:
176245
interval: 5m
177246
expiration: 168h
178247
host: basic-notification-svc.prod-green:9000
248+
profileConfigs:
249+
trace:
250+
enable: true
179251
labels:
180252
namespace: prod-green
181253
type: svc
182254
basic-pay-svc-prod-green:
183255
interval: 5m
184256
expiration: 168h
185257
host: basic-pay-svc.prod-green:9000
258+
profileConfigs:
259+
trace:
260+
enable: true
186261
labels:
187262
namespace: prod-green
188263
type: svc
189264
basic-tag-svc-prod-green:
190265
interval: 5m
191266
expiration: 168h
192267
host: basic-tag-svc.prod-green:9000
268+
profileConfigs:
269+
trace:
270+
enable: true
193271
labels:
194272
namespace: prod-green
195273
type: svc
196274
basic-user-svc-prod-green:
197275
interval: 5m
198276
expiration: 168h
199277
host: basic-user-svc.prod-green:9000
278+
profileConfigs:
279+
trace:
280+
enable: true
200281
labels:
201282
namespace: prod-green
202283
type: svc

pkg/collector/config.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,6 @@ func defaultProfileConfigs() map[string]ProfileConfig {
9090
Path: "/debug/fgprof?seconds=10",
9191
Enable: utils.BoolPtr(true),
9292
},
93-
"trace": {
94-
Path: "/debug/pprof/trace?seconds=10",
95-
Enable: utils.BoolPtr(true),
96-
},
9793
"mutex": {
9894
Path: "/debug/pprof/mutex",
9995
Enable: utils.BoolPtr(true),
@@ -118,6 +114,10 @@ func defaultProfileConfigs() map[string]ProfileConfig {
118114
Path: "/debug/pprof/threadcreate",
119115
Enable: utils.BoolPtr(true),
120116
},
117+
"trace": {
118+
Path: "/debug/pprof/trace?seconds=10",
119+
Enable: utils.BoolPtr(false),
120+
},
121121
}
122122
}
123123

@@ -137,11 +137,9 @@ func buildProfileConfigs(profileConfig map[string]ProfileConfig) map[string]Prof
137137
if config.Enable == nil {
138138
config.Enable = defaultConfig.Enable
139139
}
140-
141140
profiles[key] = config
142141
continue
143142
}
144-
145143
profiles[key] = defaultConfig
146144
}
147145
return profiles

pkg/storage/errors.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ package storage
33
import "errors"
44

55
var (
6-
ErrProfileNotFound = errors.New("Profile not found")
6+
ErrProfileNotFound = errors.New("profile not found")
77
)

0 commit comments

Comments
 (0)