Skip to content
This repository was archived by the owner on Oct 3, 2023. It is now read-only.

Commit aeb0264

Browse files
committed
Add wrapEmitter to req and res, Improving debug mensages
1 parent 499bcb1 commit aeb0264

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

packages/opencensus-core/src/trace/model/root-span.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export class RootSpan extends SpanBaseModel implements OnEndSpanEventListener {
7171
}
7272

7373
public onEndSpan(span: Span) {
74-
debug('%s notified ending by %o',{id: span.id, name: span.name})
74+
debug('ended span notified %o', {id: span.id, name: span.name})
7575
}
7676

7777
public startSpan(name: string, type: string) {

packages/opencensus-core/src/trace/model/tracer.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,13 @@ export class Tracer implements OnEndSpanEventListener {
7878

7979

8080
public onEndSpan(root:RootSpan): void {
81-
if (!this.currentRootSpan) {
81+
if (!root) {
8282
return debug('cannot end trace - no active trace found')
8383
}
8484
if(this.currentRootSpan != root) {
85-
return debug('currentRootSpan != root on notifyEnd. Possbile implementation bug.')
85+
debug('currentRootSpan != root on notifyEnd. Need more investigation.')
8686
}
87-
this.notifyEndSpan(this.currentRootSpan);
87+
this.notifyEndSpan(root);
8888
//this.clearCurrentTrace();
8989
}
9090

@@ -95,6 +95,7 @@ export class Tracer implements OnEndSpanEventListener {
9595

9696
private notifyEndSpan(root: RootSpan) {
9797
if (this.active) {
98+
debug ('starting to notify listeners the end of rootspans')
9899
if(this.eventListeners&&this.eventListeners.length >0) {
99100
this.eventListeners.forEach((listener) => listener.onEndSpan(root))
100101
}

0 commit comments

Comments
 (0)