[ 
https://issues.apache.org/jira/browse/HTRACE-144?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14381010#comment-14381010
 ] 

Colin Patrick McCabe commented on HTRACE-144:
---------------------------------------------

overview of the patch:

* htraced now looks for a special header on the {{/writeSpans}} request, named 
{{htrace-pid}}.  If this header is present, htraced will use the value of this 
header to fill in the processId value of any span in the batch with no 
processId.  So if our batch contains 1000 spans, we only send the processId one 
time, and don't need to repeat it for all 1000.  It is still possible to 
special different processIds for various spans if you like (this may be useful 
when forwarding requests from one node to another).

* Span.java: I added a {{Span#setProcessId}} method, and added comments that 
none of the getters can ever return a null value.  I also no longer require all 
fields in the span json to be present.  If a field is missing from the span 
JSON, we assume that it is the empty string / zero value for that field.

* Trace.java / Tracer.java: remove the getProcessId() / setProcessId() methods. 
 These methods were never used in Hadoop or HBase.  They are prone to race 
conditions since there is no synchronization.  Since they're global, it's very 
messy.  Instead, we now configure the process ID by setting the "process.id" 
configuration value (for Hadoop, this would be "hadoop.htrace.process.id")  
Each span receiver is responsible for setting the process ID appropriately on 
spans which don't already have it set.  The value should be passed through 
unchanged for spans where it is set.

* SpanId.java: the process ID configured by "hadoop.htrace.process.id" / 
"hbase.htrace.process.id" / etc. is processed here.  Process ID configuration 
strings can contain variables such as {{$\{ip\}}}, {{$\{pname\}}}, and so 
forth.  (later, we can add {{$\{host\}}}).  These are replaced by the 
appropriate value at runtime.

* TestLocalFileSpanReceiver.java: test that we correctly write out the process 
id

* TestMilliSpan.java: test serialization and deserialization of spans with 
nothing set.

* TestProcessId.java: test some of the values we can configure for process id.

* FlumeSpanReceiver.java / HBaseSpanReceiver.java / HTracedRESTReceiver.java / 
ZipkinSpanReceiver.java: appropriate modifications to set processId when it is 
unset

* TestHTracedRESTReceiver.java: test that we can deserialize the spans we sent, 
and that they have the appropriate process id.

> Include IP address in span process description
> ----------------------------------------------
>
>                 Key: HTRACE-144
>                 URL: https://issues.apache.org/jira/browse/HTRACE-144
>             Project: HTrace
>          Issue Type: Improvement
>    Affects Versions: 3.2.0
>            Reporter: Colin Patrick McCabe
>            Assignee: Colin Patrick McCabe
>         Attachments: HTRACE-144.001.patch
>
>
> Right now, we have no IP address or hostname specified in the span process 
> description.  So if we have 100 datanodes, the spans from all of them simply 
> show up as "DataNode."  Obviously this is unsatisfactory.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to