@@ -28,16 +28,13 @@ import (
28
28
29
29
var defaultFormat propagation.HTTPFormat = & b3.HTTPFormat {}
30
30
31
-
32
- // Health checking is pretty frequent and
33
- // traces collected for health endpoints
34
- // can be extremely noisy and expensive.
35
31
// Disable canonical health checking endpoints
36
32
// like /healthz and /_ah/health for now.
37
- var HealthEndpoints = map [string ]bool {
33
+ var untraceableEndpoints = map [string ]bool {
38
34
"/healthz" : true ,
39
35
"/_ah/health" : true ,
40
36
}
37
+
41
38
// Attributes recorded on the span for the requests.
42
39
// Only trace exporters will need them.
43
40
const (
@@ -215,8 +212,18 @@ var codeToStr = map[int32]string{
215
212
trace .StatusCodeUnauthenticated : `"UNAUTHENTICATED"` ,
216
213
}
217
214
218
- func isHealthEndpoint (path string ) bool {
219
- if _ , exist := HealthEndpoints [path ]; exist {
215
+ // Set Untraceable Endpoints like Health checking
216
+ // is pretty frequent and traces collected
217
+ // for health endpoints can be extremely noisy and expensive.
218
+ func SetUntraceableEndpoints (newUntraceableEndpoints []string ) {
219
+ untraceableEndpoints = map [string ]bool {}
220
+ for _ , endpoint := range newUntraceableEndpoints {
221
+ untraceableEndpoints [endpoint ] = true
222
+ }
223
+ }
224
+
225
+ func isUntraceableEndpoints (path string ) bool {
226
+ if _ , exist := untraceableEndpoints [path ]; exist {
220
227
return true
221
228
}
222
229
return false
0 commit comments