This repository was archived by the owner on Jul 31, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed
Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,16 @@ 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.
35+ // Disable canonical health checking endpoints
36+ // like /healthz and /_ah/health for now.
37+ var HealthEndpoints = map [string ]bool {
38+ "/healthz" : true ,
39+ "/_ah/health" : true ,
40+ }
3141// Attributes recorded on the span for the requests.
3242// Only trace exporters will need them.
3343const (
@@ -206,12 +216,7 @@ var codeToStr = map[int32]string{
206216}
207217
208218func isHealthEndpoint (path string ) bool {
209- // Health checking is pretty frequent and
210- // traces collected for health endpoints
211- // can be extremely noisy and expensive.
212- // Disable canonical health checking endpoints
213- // like /healthz and /_ah/health for now.
214- if path == "/healthz" || path == "/_ah/health" {
219+ if _ , exist := HealthEndpoints [path ]; exist {
215220 return true
216221 }
217222 return false
You can’t perform that action at this time.
0 commit comments