This repository was archived by the owner on Oct 3, 2023. It is now read-only.
File tree Expand file tree Collapse file tree
packages/opencensus-core/src/trace/model Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -72,7 +72,7 @@ export class RootSpan extends SpanBaseModel implements OnEndSpanEventListener {
7272 }
7373
7474 public onEndSpan ( span : Span ) {
75- debug ( '%s notified ending by %o' , { id : span . id , name : span . name } )
75+ debug ( 'ended span notified %o' , { id : span . id , name : span . name } )
7676 }
7777
7878 public startSpan ( name : string , type : string ) {
Original file line number Diff line number Diff line change @@ -92,14 +92,14 @@ export class Tracer implements OnEndSpanEventListener {
9292 }
9393
9494
95- public onEndSpan ( root : RootSpan ) : void {
96- if ( ! this . currentRootSpan ) {
95+ public onEndSpan ( root :RootSpan ) : void {
96+ if ( ! root ) {
9797 return debug ( 'cannot end trace - no active trace found' )
9898 }
99- if ( this . currentRootSpan != root ) {
100- return debug ( 'currentRootSpan != root on notifyEnd. Possbile implementation bug .' )
99+ if ( this . currentRootSpan != root ) {
100+ debug ( 'currentRootSpan != root on notifyEnd. Need more investigation .' )
101101 }
102- this . notifyEndSpan ( this . currentRootSpan ) ;
102+ this . notifyEndSpan ( root ) ;
103103 //this.clearCurrentTrace();
104104 }
105105
@@ -111,8 +111,8 @@ export class Tracer implements OnEndSpanEventListener {
111111
112112 private notifyEndSpan ( root : RootSpan ) {
113113 if ( this . active ) {
114- //this.buffer.onEndSpan(root);
115- if ( this . eventListeners && this . eventListeners . length > 0 ) {
114+ debug ( 'starting to notify listeners the end of rootspans' )
115+ if ( this . eventListeners && this . eventListeners . length > 0 ) {
116116 this . eventListeners . forEach ( ( listener ) => listener . onEndSpan ( root ) )
117117 }
118118 } else {
You can’t perform that action at this time.
0 commit comments