bugfix: create spans for nested tasks in gather, rasa, and dial; fix gather bug not starting transcribe after say completes

This commit is contained in:
Dave Horton
2022-03-29 15:44:55 -04:00
parent 6e4ae69cb7
commit ff8d7f3648
5 changed files with 56 additions and 8 deletions

View File

@@ -81,6 +81,15 @@ class Task extends Emitter {
return span;
}
startChildSpan(name, attributes) {
const {srf} = require('../..');
const {tracer} = srf.locals.otel;
const span = tracer.startSpan(name, undefined, this.ctx);
if (attributes) span.setAttributes(attributes);
const ctx = trace.setSpan(this.ctx, span);
return {span, ctx};
}
/**
* when a subclass Task has completed its work, it should call this method
*/