Adding start and end span examples
This commit is contained in:
parent
671ec85997
commit
909cb4b77d
17
Conversation Design/Conversation Flows/endSpan.js
Normal file
17
Conversation Design/Conversation Flows/endSpan.js
Normal file
@ -0,0 +1,17 @@
|
||||
(async () => {
|
||||
await opentelemetry().endSpan();
|
||||
})()
|
||||
.catch((error) => {
|
||||
console.log(error.message);
|
||||
recognizedObject.answers.push("");
|
||||
recognizedObject.errorInfo = {
|
||||
...recognizedObject.errorInfo,
|
||||
label: {
|
||||
data: error.toJSON ? error.toJSON() : {},
|
||||
message: error.message,
|
||||
},
|
||||
};
|
||||
})
|
||||
.finally(() => {
|
||||
next();
|
||||
});
|
||||
20
Conversation Design/Conversation Flows/startSpan.js
Normal file
20
Conversation Design/Conversation Flows/startSpan.js
Normal file
@ -0,0 +1,20 @@
|
||||
(async () => {
|
||||
await latencySpan().endSpan(recognizedObject.conversationId);
|
||||
|
||||
const span = await opentelemetry().startSpan("Global Flow");
|
||||
console.log(span);
|
||||
})()
|
||||
.catch((error) => {
|
||||
console.log(error.message);
|
||||
recognizedObject.answers.push("");
|
||||
recognizedObject.errorInfo = {
|
||||
...recognizedObject.errorInfo,
|
||||
label: {
|
||||
data: error.toJSON ? error.toJSON() : {},
|
||||
message: error.message,
|
||||
},
|
||||
};
|
||||
})
|
||||
.finally(() => {
|
||||
next();
|
||||
});
|
||||
Loading…
x
Reference in New Issue
Block a user