File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# Changelog
22
3+ ## NEXT
4+
5+ * Fix sampler option. [ #87 ] ( https://github.com/DanielMSchmidt/zipkin-javascript-opentracing/pull/87 )
6+
37## 2.0.0
48
59* [ Change carrier formats to be openzipkin ones] ( https://github.com/DanielMSchmidt/zipkin-javascript-opentracing/pull/72 )
Original file line number Diff line number Diff line change @@ -124,7 +124,8 @@ module.exports = {
124124 } ,
125125 option : require ( "zipkin-option" ) ,
126126 sampler : {
127- alwaysSampler : jest . fn ( ( ) => true )
127+ alwaysSample : jest . fn ( ( ) => true ) ,
128+ Sampler : jest . fn ( )
128129 } ,
129130 jsonEncoder : {
130131 JSON_V1 : jest . fn ( )
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ const opentracing = require("opentracing");
22const Tracer = require ( "../index" ) ;
33const zipkin = require ( "zipkin" ) ;
44const {
5- option : { Some , None }
5+ sampler : { Sampler }
66} = zipkin ;
77
88describe ( "Opentracing interface" , ( ) => {
@@ -494,7 +494,8 @@ describe("Opentracing interface", () => {
494494
495495 expect ( zipkin . Tracer ) . toHaveBeenCalledWith ( {
496496 ctxImpl : { } ,
497- recorder : { id : 42 }
497+ recorder : { id : 42 } ,
498+ sampler : expect . any ( Sampler )
498499 } ) ;
499500 } ) ;
500501 } ) ;
Original file line number Diff line number Diff line change 22 Annotation,
33 BatchRecorder,
44 ExplicitContext,
5- Request,
65 TraceId,
76 option : { Some, None } ,
87 Tracer,
@@ -219,19 +218,20 @@ class Tracing {
219218 ) ;
220219 }
221220
222- options . sampler = options . sampler || sampler . alwaysSample ;
221+ options . sampler =
222+ options . sampler || new sampler . Sampler ( sampler . alwaysSample ) ;
223223
224224 this . _serviceName = options . serviceName ;
225225
226226 this . _zipkinTracer = new Tracer ( {
227227 ctxImpl : new ExplicitContext ( ) ,
228- recorder : options . recorder
228+ recorder : options . recorder ,
229+ sampler : options . sampler
229230 } ) ;
230231 this . _Span = SpanCreator ( {
231232 tracer : this . _zipkinTracer ,
232233 serviceName : this . _serviceName ,
233- kind : options . kind ,
234- sampler : options . sampler
234+ kind : options . kind
235235 } ) ;
236236 }
237237
You can’t perform that action at this time.
0 commit comments