microsoft / botframework-sdk

Bot Framework provides the most comprehensive experience for building conversation applications.
MIT License
7.5k stars 2.44k forks source link

LuisResult telemetry is duplicated in Application Insights #6348

Open Dan-Bai opened 3 years ago

Dan-Bai commented 3 years ago

Describe the bug

A bot using LUIS intent with telemetry enabled is occasionally logging LuisResult twice.

Version

2.0.0

OS

To Reproduce

Steps to reproduce the behavior:

  1. Create Node bot with Core Bot with QnA Maker template
  2. Add trigger with Intent Recognized for something simple (I used Help with utterance help)
  3. Start bot and open in webchat
  4. Type the utterance

Expected behavior

A single LuisResult per utterance

Screenshots

Additional context

hcyang commented 3 years ago

Hi @Dan-Bai, can you elaborate how did you find that an input utterance's LuisResult got logged twice in AppInsight telemetry? A screenshot would be much helpful.

Dan-Bai commented 3 years ago

@hcyang It was brought to my attention when our reporting had incorrect data. I then created a simple bot with an intent trigger, I was then able to see two LuisResult events in application insight for each utterance.

hcyang commented 3 years ago

Hi @dmvtech, please try to repro. Thanks.

dmvtech commented 3 years ago

hi @Dan-Bai

I believe I can reproduce the same. We will look into this and update asap. Thank you.

dmvtech commented 3 years ago

Reproduces with .NET runtime as well.

dmvtech commented 3 years ago

The other odd thing I see is that sometimes there are duplicates, but not always. As @Dan-Bai says; occasionally.

image

Stevenic commented 3 years ago

If this bot is a composer bot or using Adaptive Dialogs, this is likely being caused by the fact we end up calling the recognizer twice per turn. We should probably double check to make sure we only log telemetry once per turn...

taicchoumsft commented 3 years ago

Thanks @Stevenic , attaching that issue you're referencing here for others. I will first investigate to see if even after caching we are logging twice. If not, then the suggestion is for others to switch to 4.14

taicchoumsft commented 3 years ago

Verified that we are still logging telemetry twice per turn in 4.14.1, we will fix this for next release.