Azure / botbuilder-instrumentation

Add extra logging for bot framework
MIT License
23 stars 22 forks source link

Intents aren't captured when IntentDialog approach isn't used #11

Open iMicknl opened 7 years ago

iMicknl commented 7 years ago

There are multiple ways to start a dialog based on the intent retrieved by a recognizer. Not everyone is using the IntentDialog in their bots. At the moment botbuilder-instrumentation only captures the intent while using an Intent Dialog.

I am not sure (yet) how those events can be captured in a better way. Hooking in on LuisRecognizer.recognize should work, however it would be nice if all recognizers are supported. Maybe the intent should be captured and sent to Application Insights on the creation / initialisation of a new dialog.

bot.dialog('/', [
    (session: Session) => {
        session.endDialog('message');
    }
]).triggerAction({
    matches: 'default'
});

vs

const dialog = new builder.IntentDialog({ recognizers: [recognizer] });
bot.dialog('/', dialog);

dialog.matches('default', [
    function (session, args, next) {
        session.endDialog('message');
    }
]);
morsh commented 7 years ago

Hi @iMicknl - sorry for the long wait. We've pushed an update last week to support LuisRecognizer overloading. Since this is not an official module, it's not a perfect approach, but I think that such approach might be irrelevant as of botbuilder@4.0.0.

LuisDialog is currently deprecated, and should probably be replaced with LuisRecognizer.