@@ -44,9 +44,7 @@ const config = {
4444
4545 // or
4646
47- // type: 'haystack_agent',
48- // agentHost: '192.168.99.100',
49- // agentPort: '35000'
47+ // type: 'haystack_agent'
5048 } ,
5149 logger : logger
5250} ;
@@ -57,19 +55,19 @@ const tracer = initTracer(config);
5755/// now create a span, for e.g. at the time of incoming REST call.
5856/// Make sure to add SPAN_KIND tag. Possible values are 'server' or 'client'.
5957/// Important: if you are receiving TraceId, SpanId, ParentSpanId in the http headers or message payload of your incoming REST call,
60- /// then set it in the callerSpanContext
58+ /// then create a SpanContext with those IDs and initialize the tracer with a childOf the received SpanContext
6159
6260const serverSpan = tracer
6361 . startSpan ( 'dummy-operation' , {
64- callerSpanContext : new SpanContext (
62+ childOf : new SpanContext (
6563 '1848fadd-fa16-4b3e-8ad1-6d73339bbee7' ,
6664 '7a7cc5bf-796e-4527-9b42-13ae5766c6fd' ,
6765 'e96de653-ad6e-4ad5-b437-e81fd9d2d61d' )
6866 } )
6967 . setTag ( opentracing . Tags . SPAN_KIND , 'server' )
7068 . setTag ( opentracing . Tags . HTTP_METHOD , 'GET' ) ;
7169
72- /// Or if you are the root service, skip callerSpanContext and use the following
70+ /// Or if you are the root service
7371
7472// const serverSpan = tracer
7573// .startSpan('dummy-operation')
@@ -82,7 +80,6 @@ const serverSpan = tracer
8280/// now say service is calling downstream service, then you start another span - a client span
8381/// since this span is a child of the main serverSpan, so pass it along as `childOf` attribute.
8482/// library will setup the traceId, spanId and parentSpanId by itself.
85- /// You dont need to set the callerSpanContext if you are setting childOf
8683const clientChildSpan = tracer . startSpan ( 'downstream-service-call' , {
8784 childOf : serverSpan ,
8885 tags : {
0 commit comments