Author: jamestaylor Date: Sun Aug 17 20:07:24 2014 New Revision: 1618518 URL: http://svn.apache.org/r1618518 Log: Update tracing doc
Modified: phoenix/site/publish/tracing.html phoenix/site/source/src/site/markdown/tracing.md Modified: phoenix/site/publish/tracing.html URL: http://svn.apache.org/viewvc/phoenix/site/publish/tracing.html?rev=1618518&r1=1618517&r2=1618518&view=diff ============================================================================== --- phoenix/site/publish/tracing.html (original) +++ phoenix/site/publish/tracing.html Sun Aug 17 20:07:24 2014 @@ -1,7 +1,7 @@ <!DOCTYPE html> <!-- - Generated by Apache Maven Doxia at 2014-08-16 + Generated by Apache Maven Doxia at 2014-08-17 Rendered using Reflow Maven Skin 1.1.0 (http://andriusvelykis.github.io/reflow-maven-skin) --> <html xml:lang="en" lang="en"> @@ -132,7 +132,7 @@ <p>There are only a couple small things you need to do to enable tracing a given request with Phoenix.</p> <div class="section"> <h3 id="Client_Property">Client Property</h3> - <p>The frequency of tracing is determined by the client JDBC property:</p> + <p>The frequency of tracing is determined by the following client-side HBase configuration property:</p> <div class="source"> <pre>phoenix.trace.frequency </pre> @@ -150,22 +150,21 @@ <li>probability <ul> <li>take traces with a probabilistic frequency</li> - <li>probability threshold set by: âphoenix.trace.probability.thresholdâ</li> + <li>probability threshold is set by <tt>phoenix.trace.probability.threshold</tt> with a default of 0.05 (5%).</li> </ul></li> </ol> - <p>By turning one of these properties on, you turn on merely collecting the traces. However, the traces need to be deposited somewhere</p> + <p>As with other configuration properties, this property may be specified at JDBC connection time as a connection property. By turning one of these properties on, you turn on merely collecting the traces. However, the traces need to be deposited somewhere</p> <p>Example:</p> <div class="source"> <pre># Enable tracing on every request Properties props = new Properties(); props.setProperty("phoenix.trace.frequency", "always"); - -# Or more simply -org.apache.phoenix.trace.Tracing.setSampling(props, Tracing.Frequency.ALWAYS); +Connection conn = DriverManager.getConnection("jdbc:phoenix:localhost", props); # Enable tracing on 50% of requests -org.apache.phoenix.trace.Tracing.setSampling(props, Tracing.Frequency.ALWAYS); -props.setProperty("phoenix.trace.probability.threshold", .5) +props.setProperty("phoenix.trace.frequency", "probability"); +props.setProperty("phoenix.trace.probability.threshold", 0.5) +Connection conn = DriverManager.getConnection("jdbc:phoenix:localhost", props); </pre> </div> </div> @@ -183,10 +182,10 @@ phoenix.sink.writer-class=org.apache.pho </div> <div class="section"> <h2 id="Reading_Traces">Reading Traces</h2> - <p>Once the traces are deposited into the tracing table, by default <tt>PHOENIX.TRACING_STATS</tt>, but it is configurable in the HBase configuration via:</p> + <p>Once the traces are deposited into the tracing table, by default <tt>SYSTEM.TRACING_STATS</tt>, but it is configurable in the HBase configuration via:</p> <div class="source"> <pre> <property> - <name>phoenix._internal.trace.tablename</name> + <name>phoenix.trace.statsTableName</name> <value><your custom tracing table name></value> </property> </pre> @@ -194,7 +193,7 @@ phoenix.sink.writer-class=org.apache.pho <p>The tracing table is initialized via the ddl:</p> <div> <pre> - CREATE TABLE <b>PHOENIX.TRACING_STATS</b> ( + CREATE TABLE <b>SYSTEM.TRACING_STATS</b> ( <b>trace_id</b> BIGINT NOT NULL, <b>parent_id</b> BIGINT NOT NULL, <b>span_id</b> BIGINT NOT NULL, @@ -210,13 +209,13 @@ phoenix.sink.writer-class=org.apache.pho <p>The tracing table also contains a number of dynamic columns for each trace, identified by a unique trace-id (id of the request), parent-id (id of the parent span) and individual span-id (id of the individual segment), may have multiple tags and annotations about what happened during the trace. Once you have the number of tags and annotations, you can retrieve them the table with a request like:</p> <div class="source"> <pre>SELECT <columns> - FROM PHOENIX.TRACING_STATS + FROM SYSTEM.TRACING_STATS WHERE trace_id = ? AND parent_id = ? ANd span_id = ? </pre> </div> - <p>where columns is either âannotations.aXâ or âtags.tXâ where âXâ is the index of the dynamic column to lookup.</p> + <p>where columns is either <tt>annotations.aX</tt> or <tt>tags.tX</tt> where <tt>X</tt> is the index of the dynamic column to lookup.</p> <p>For more usage, look at our generic <a class="externalLink" href="https://github.com/apache/phoenix/blob/master/phoenix-core/src/main/java/org/apache/phoenix/trace/TraceReader.java">TraceReader</a> which can programatically read a number of traces from the tracing results table.</p> </div> </div> Modified: phoenix/site/source/src/site/markdown/tracing.md URL: http://svn.apache.org/viewvc/phoenix/site/source/src/site/markdown/tracing.md?rev=1618518&r1=1618517&r2=1618518&view=diff ============================================================================== --- phoenix/site/source/src/site/markdown/tracing.md (original) +++ phoenix/site/source/src/site/markdown/tracing.md Sun Aug 17 20:07:24 2014 @@ -12,7 +12,7 @@ There are only a couple small things you ### Client Property -The frequency of tracing is determined by the client JDBC property: +The frequency of tracing is determined by the following client-side HBase configuration property: ``` phoenix.trace.frequency @@ -26,8 +26,9 @@ There are three possible tracing frequen * Every request will be traced 3. probability * take traces with a probabilistic frequency - * probability threshold set by: "phoenix.trace.probability.threshold" + * probability threshold is set by <code>phoenix.trace.probability.threshold</code> with a default of 0.05 (5%). +As with other configuration properties, this property may be specified at JDBC connection time as a connection property. By turning one of these properties on, you turn on merely collecting the traces. However, the traces need to be deposited somewhere Example: @@ -36,13 +37,12 @@ Example: # Enable tracing on every request Properties props = new Properties(); props.setProperty("phoenix.trace.frequency", "always"); - -# Or more simply -org.apache.phoenix.trace.Tracing.setSampling(props, Tracing.Frequency.ALWAYS); +Connection conn = DriverManager.getConnection("jdbc:phoenix:localhost", props); # Enable tracing on 50% of requests -org.apache.phoenix.trace.Tracing.setSampling(props, Tracing.Frequency.ALWAYS); -props.setProperty("phoenix.trace.probability.threshold", .5) +props.setProperty("phoenix.trace.frequency", "probability"); +props.setProperty("phoenix.trace.probability.threshold", 0.5) +Connection conn = DriverManager.getConnection("jdbc:phoenix:localhost", props); ``` ### Enabling Tracing/Metrics2 Sink @@ -58,11 +58,11 @@ phoenix.sink.writer-class=org.apache.pho ## Reading Traces -Once the traces are deposited into the tracing table, by default <code>PHOENIX.TRACING_STATS</code>, but it is configurable in the HBase configuration via: +Once the traces are deposited into the tracing table, by default <code>SYSTEM.TRACING_STATS</code>, but it is configurable in the HBase configuration via: ``` <property> - <name>phoenix._internal.trace.tablename</name> + <name>phoenix.trace.statsTableName</name> <value><your custom tracing table name></value> </property> ``` @@ -70,7 +70,7 @@ Once the traces are deposited into the t The tracing table is initialized via the ddl: <pre> - CREATE TABLE <b>PHOENIX.TRACING_STATS</b> ( + CREATE TABLE <b>SYSTEM.TRACING_STATS</b> ( <b>trace_id</b> BIGINT NOT NULL, <b>parent_id</b> BIGINT NOT NULL, <b>span_id</b> BIGINT NOT NULL, @@ -87,11 +87,11 @@ The tracing table also contains a number ``` SELECT <columns> - FROM PHOENIX.TRACING_STATS + FROM SYSTEM.TRACING_STATS WHERE trace_id = ? AND parent_id = ? ANd span_id = ? ``` -where columns is either "annotations.aX" or "tags.tX" where 'X' is the index of the dynamic column to lookup. +where columns is either <code>annotations.aX</code> or <code>tags.tX</code> where <code>X</code> is the index of the dynamic column to lookup. For more usage, look at our generic [TraceReader](https://github.com/apache/phoenix/blob/master/phoenix-core/src/main/java/org/apache/phoenix/trace/TraceReader.java) which can programatically read a number of traces from the tracing results table.