further tracing UI cleanup

This commit is contained in:
Dave Horton
2023-05-08 14:08:32 -04:00
parent 60a09a48c1
commit bb0eed1626
3 changed files with 12 additions and 8 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);
@@ -1292,9 +1293,10 @@ class CallSession extends Emitter {
}
else {
const {queue, command} = resolution;
const {span} = this.rootSpan.startChildSpan(`recv command: ${command}`);
const {span} = this.rootSpan.startChildSpan(`recv cmd: ${command}`);
span.setAttributes({
'async.request.queue': queue,
'async.request.command': command
});
span.end();
}

View File

@@ -30,6 +30,12 @@ class TaskConfig extends Task {
if (this.bargeIn[k]) this.gatherOpts[k] = this.bargeIn[k];
});
}
if (this.data.reset) {
if (typeof this.data.reset === 'string') this.data.reset = [this.data.reset];
}
else this.data.reset = [];
if (this.bargeIn.sticky) this.autoEnable = true;
this.preconditions = (this.bargeIn.enable || this.record?.action || this.listen?.url || this.data.amd) ?
TaskPreconditions.Endpoint :
@@ -47,11 +53,7 @@ class TaskConfig extends Task {
const phrase = [];
/* reset recognizer and/or synthesizer to default values? */
if (this.data.reset) {
if (typeof this.data.reset === 'string') this.data.reset = [this.data.reset];
if (this.data.reset.length) phrase.push(`reset ${this.data.reset.join(',')}`);
}
else this.data.reset = [];
if (this.data.reset.length) phrase.push(`reset ${this.data.reset.join(',')}`);
if (this.bargeIn.enable) phrase.push('enable barge-in');
if (this.hasSynthesizer) {
@@ -70,7 +72,7 @@ class TaskConfig extends Task {
}
if (this.data.amd) phrase.push('enable amd');
if (this.notifyEvents) phrase.push(`event notification ${this.notifyEvents ? 'on' : 'off'}`);
return `${this.name}{${phrase.join(',')}`;
return `${this.name}{${phrase.join(',')}}`;
}
async exec(cs, {ep} = {}) {

View File

@@ -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} (${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)});