Open toffaletti opened 6 years ago
Agree this would be better enabled at runtime.
Thank you for filing this @toffaletti and thanks @ramonza for working on it!
@ramonza do you think we should remove that init invocation that enables zpages on the zpages.Handler variable? What else could we do here? Thank you.
FYI in Java ZPages needs to be explicitly initialized in application code: https://github.com/census-instrumentation/opencensus-java/blob/9d533927c764069641ed56dcdcd0a83d05a5a14a/examples/src/main/java/io/opencensus/examples/zpages/ZPagesTester.java#L105
I think we can go ahead now and remove the Handler var that causes eager init.
It is a bit surprising that just importing zpages package (even if you don't register a handler) causes the infinite memory growth described in #597 even if DefaultSampler is NeverSample because of
and
This means enabling / disabling has to be done with a build tag right now, but a runtime command line flag would be best.