Trying to understand the process to enable HTrace. Following is the change
to hbase-site.xml
<property>
<name>hbase.trace.spanreceiver.localfilespanreceiver.filename</name>
<value>/var/log/hbase/htrace.out</value>
</property>
Following is a simple code to trace a get call
public static void main(String[] args) throws IOException {
Configuration conf = HBaseConfiguration.create();
TraceScope getSpan = Trace.startSpan("Gets", Sampler.ALWAYS);
try{
System.out.println("Is tracing on :"+Trace.isTracing());
HTable table = new HTable(conf, "t1");
Get get = new Get(Bytes.toBytes("r1"));
Result res = table.get(get);
System.out.println(res.toString());
table.close();
} catch(Exception e) {
getSpan.close();
} finally {
getSpan.close();
}
}
Is something missed
?
No trace file is getting
generated
. Thanks in advance.
Thanks,
Biju