Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

contrib/gorilla/mux: skip tracing for some requests #790

Closed
stroem opened this issue Dec 16, 2020 · 1 comment
Closed

contrib/gorilla/mux: skip tracing for some requests #790

stroem opened this issue Dec 16, 2020 · 1 comment

Comments

@stroem
Copy link
Contributor

stroem commented Dec 16, 2020

Would be nice to skip creating spans for some of the requests.
Like e.g health-endpoints.

ochttp solves it this way (https://github.com/census-instrumentation/opencensus-go/blob/master/plugin/ochttp/server.go#L74):

svr = &http.Server{
    Addr: ":8080",
    Handler: &ochttp.Handler{
	    Handler:          s.mux,
	    IsPublicEndpoint: true,
	    IsHealthEndpoint: func(req *http.Request) bool {
		    switch req.URL.Path {
		    case "/health", "/health/":
			    return true
		    default:
			    return false
		    }
	    },
    },
  }
@stroem stroem changed the title contrib/gorilla/mux skip tracing for some requests contrib/gorilla/mux: skip tracing for some requests Dec 16, 2020
@gbbr
Copy link
Contributor

gbbr commented Dec 17, 2020

This sounds good to me, and the PR is close to what we want. I'd like to suggest playing with the naming a bit, perhaps bringing it closer to what we have in the gRPC integration for similar functionality. How about WithIgnoreRequest ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants