[
https://issues.apache.org/jira/browse/HTRACE-324?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15049273#comment-15049273
]
stack commented on HTRACE-324:
------------------------------
Add how to set up a receiver with examples.
> Document tracer setup, the passing of traces across RPC,
> ---------------------------------------------------------
>
> Key: HTRACE-324
> URL: https://issues.apache.org/jira/browse/HTRACE-324
> Project: HTrace
> Issue Type: Task
> Components: docs
> Reporter: stack
>
> Doc why you should create a tracer always and create it early in your
> process. Then that you should start up a scope near immediately also so that
> your tracer context is available down the stack if anyone needs to pluck it
> from current thread context. Explain NPE when you do
> Tracer.curThreadTracer... and of how to fix and of how early setup allows you
> avoid this ugly idiom that requires null checks:
> {code}
> + Tracer tracer = Tracer.curThreadTracer();
> + TraceScope scope = tracer == null? null:
> + tracer.newScope("MemStoreFluser.reclaimMemStoreMemory");
> ...
> + if (scope != null) scope.close();
> {code}
> Doc you should close tracer when done
> Fix the current page because it has deprecated way of setting up a new Tracer
> using deprecated name method (this may be fixed already, we just haven't
> pushed it).
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)