From 1b91e8d0a0023ebde3a4a5ddd91a5362f4e8aed4 Mon Sep 17 00:00:00 2001 From: Dave Horton Date: Mon, 8 May 2023 13:47:10 -0400 Subject: [PATCH] tracing usability --- lib/session/call-session.js | 5 +++-- lib/tasks/task.js | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/session/call-session.js b/lib/session/call-session.js index 35515734..e2a3017d 100644 --- a/lib/session/call-session.js +++ b/lib/session/call-session.js @@ -784,6 +784,7 @@ class CallSession extends Emitter { if (0 === this.tasks.length && this.requestor instanceof WsRequestor && !this.callGone) { let span; try { + /* const {span} = this.rootSpan.startChildSpan('waiting for commands'); const {reason, queue, command} = await this._awaitCommandsOrHangup(); span.setAttributes({ @@ -792,6 +793,7 @@ class CallSession extends Emitter { 'async.request.command': command }); span.end(); + */ if (this.callGone) break; } catch (err) { span.end(); @@ -1288,11 +1290,10 @@ class CallSession extends Emitter { this.wakeupResolver = null; } else { - const {span} = this.rootSpan.startChildSpan('async command'); const {queue, command} = resolution; + const {span} = this.rootSpan.startChildSpan(`recv: ${command}`); span.setAttributes({ 'async.request.queue': queue, - 'async.request.command': command }); span.end(); } diff --git a/lib/tasks/task.js b/lib/tasks/task.js index 2583d7f7..dc135800 100644 --- a/lib/tasks/task.js +++ b/lib/tasks/task.js @@ -155,7 +155,7 @@ class Task extends Emitter { if (this.actionHook) { const type = this.name === TaskName.Redirect ? 'session:redirect' : 'verb:hook'; const params = results ? Object.assign(this.cs.callInfo.toJSON(), results) : this.cs.callInfo.toJSON(); - const span = this.startSpan(type, {'hook.url': this.actionHook}); + const span = this.startSpan(`${type} (${this.actionHook}`); const b3 = this.getTracingPropagation('b3', span); const httpHeaders = b3 && {b3}; span.setAttributes({'http.body': JSON.stringify(params)});