Partial mux tracing #5619
Answered
by
dmathieu
appiepollo14
asked this question in
Q&A
Partial mux tracing
#5619
-
Hi, In this beautiful example, the whole mux server is being traced. I'm trying to find out how to do partial tracing, meaning, selected endpoints to be traced and not /health / ready. Does anyone have a gist or an example how to do this with mux? Kind regards, Asjer |
Beta Was this translation helpful? Give feedback.
Answered by
dmathieu
Jul 16, 2024
Replies: 1 comment 1 reply
-
You can do this using the WithFilter option. handler := otelhttp.NewHandler(mux, "/", otelhttp.WithFilter(func(r *http.Request) bool {
if (r.URL.Path == "/health" || r.URL.Path == "/ready") {
return false
}
return true
}) |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
appiepollo14
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
You can do this using the WithFilter option.
Something like this: