Fix/tracing cleanup (#342)

* tracing usability

* fix bug in prev commit

* more cleanup

* further tracing UI cleanup
This commit is contained in:
Dave Horton
2023-05-08 14:35:07 -04:00
committed by GitHub
parent 5043edfd4e
commit 7a184a8bbc
3 changed files with 18 additions and 12 deletions

View File

@@ -761,6 +761,7 @@ class CallSession extends Emitter {
}
if (!skip) {
const {span, ctx} = this.rootSpan.startChildSpan(`verb:${task.summary}`);
span.setAttributes({'verb.summary': task.summary});
task.span = span;
task.ctx = ctx;
await task.exec(this, resources);
@@ -782,19 +783,22 @@ class CallSession extends Emitter {
}
if (0 === this.tasks.length && this.requestor instanceof WsRequestor && !this.callGone) {
let span;
//let span;
try {
const {span} = this.rootSpan.startChildSpan('waiting for commands');
const {reason, queue, command} = await this._awaitCommandsOrHangup();
//const {span} = this.rootSpan.startChildSpan('waiting for commands');
//const {reason, queue, command} = await this._awaitCommandsOrHangup();
/*
span.setAttributes({
'completion.reason': reason,
'async.request.queue': queue,
'async.request.command': command
});
span.end();
*/
await this._awaitCommandsOrHangup();
if (this.callGone) break;
} catch (err) {
span.end();
//span.end();
this.logger.info(err, 'CallSession:exec - error waiting for new commands');
break;
}
@@ -1288,8 +1292,8 @@ 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 cmd: ${command}`);
span.setAttributes({
'async.request.queue': queue,
'async.request.command': command