@@ -28,16 +28,13 @@ import (
2828
2929var defaultFormat propagation.HTTPFormat = & b3.HTTPFormat {}
3030
31-
32- // Health checking is pretty frequent and
33- // traces collected for health endpoints
34- // can be extremely noisy and expensive.
3531// Disable canonical health checking endpoints
3632// like /healthz and /_ah/health for now.
37- var HealthEndpoints = map [string ]bool {
33+ var untraceableEndpoints = map [string ]bool {
3834 "/healthz" : true ,
3935 "/_ah/health" : true ,
4036}
37+
4138// Attributes recorded on the span for the requests.
4239// Only trace exporters will need them.
4340const (
@@ -215,8 +212,18 @@ var codeToStr = map[int32]string{
215212 trace .StatusCodeUnauthenticated : `"UNAUTHENTICATED"` ,
216213}
217214
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 {
220227 return true
221228 }
222229 return false
0 commit comments