Skip to content
This repository has been archived by the owner on Jul 31, 2023. It is now read-only.

Don't trace /healthz #844

Merged
merged 1 commit into from
Jul 24, 2018
Merged

Conversation

rakyll
Copy link
Contributor

@rakyll rakyll commented Jul 24, 2018

Kubernetes users end up having tons of /healthz traces
which is costly and no-value.

Disable /healthz tracing until we have a better solution.

@rakyll rakyll requested review from semistrict and songy23 July 24, 2018 05:42
@rakyll
Copy link
Contributor Author

rakyll commented Jul 24, 2018

/cc @kelseyhightower

@rakyll
Copy link
Contributor Author

rakyll commented Jul 24, 2018

I will update the PR to also add _ah/health.

@@ -57,6 +57,9 @@ type Transport struct {
// RoundTrip implements http.RoundTripper, delegating to Base and recording stats and traces for the request.
func (t *Transport) RoundTrip(req *http.Request) (*http.Response, error) {
rt := t.base()
if req.URL.Path == "/healthz" {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick fix @rakyll!

Could we please add a comment for the rationale of this change?

// Disable tracing /healthz since tracing it is costly and
// it bloats Kubernetes traces without adding much value

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@rakyll
Copy link
Contributor Author

rakyll commented Jul 24, 2018

Also needs support for the server.

@rakyll
Copy link
Contributor Author

rakyll commented Jul 24, 2018

Needs tests for the client spans.

Copy link
Member

@odeke-em odeke-em left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect, thanks @rakyll! LGTM!

Kubernetes users end up having tons of /healthz traces
which is costly and no-value.

Disable /healthz tracing until we have a better solution.
@rakyll rakyll merged commit 9260bbf into census-instrumentation:master Jul 24, 2018
@rakyll rakyll deleted the healthz branch July 24, 2018 15:42
@basvanbeek
Copy link
Member

I feel this is rushed in, which might have been necessary but I'd like to revisit with a better solution for the future...

this just hard coded a couple of paths to disable tracing. I can see where we'd want it configurable depending on the consumer's ecosystem and maybe make it possible to decide path based sampling strategy instead of only a hard drop all for certain paths. that would allow for more functionality while also providing a good solution for this situation (with these paths using the neverSample strategy)

@semistrict
Copy link
Contributor

agree with @basvanbeek, this should have been discussed more broadly probably on the specs repo. what was the justification for rushing it in like this?

@rakyll
Copy link
Contributor Author

rakyll commented Jul 25, 2018

Sorry, this was rushed in. I created census-instrumentation/opencensus-specs#151 but haven't proposed anything new such as a blacklisting mechanism. Let's discuss on the specs what we want to do and fix the implementation accordingly.

@mtwo
Copy link

mtwo commented Jul 25, 2018

Agree with Bas, we should have a simple blacklist like OC Ruby (I think) does. For example, it'd be great to not trace requests for Stackdriver Profiler.

@rakyll
Copy link
Contributor Author

rakyll commented Jul 25, 2018

@mtwo, can you update the spec issue I have field? Let's keep the conversation over there.

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

Successfully merging this pull request may close these issues.

5 participants