Skip to content
This repository has been archived by the owner on Jun 30, 2022. It is now read-only.

BotTelemetry not storing any details in Application Insights #3725

Closed
UtkarshSinghal17 opened this issue Nov 25, 2020 · 13 comments
Closed

BotTelemetry not storing any details in Application Insights #3725

UtkarshSinghal17 opened this issue Nov 25, 2020 · 13 comments
Assignees
Labels
Bot Services Required for internal Azure reporting. Do not delete. Do not change color. customer-replied-to Indicates that the team has replied to the issue reported by the customer. Do not delete. customer-reported Issue is created by anyone that is not a collaborator in the repository. Team: Kobuk This issue is assigned to the Kobuk team. Type: Bug Something isn't working

Comments

@UtkarshSinghal17
Copy link

UtkarshSinghal17 commented Nov 25, 2020

What project is affected?

Virtual Assistant Template

What language is this in?

C#

What happens?

I have added telemetry to my bot and I am using the power BI template given by Microsoft but In data, everything is showing as null. and for directline, facebook channel nothing is storing.
I have enabled telemetry using the below line of code in the startup file.

        services.AddApplicationInsightsTelemetry();
       services.AddSingleton<IBotTelemetryClient, BotTelemetryClient>();
        services.AddSingleton<ITelemetryInitializer, OperationCorrelationTelemetryInitializer>();
        services.AddSingleton<ITelemetryInitializer, TelemetryBotIdInitializer>();
        services.AddSingleton<TelemetryInitializerMiddleware>();
        services.AddSingleton<TelemetryLoggerMiddleware>(s => new TelemetryLoggerMiddleware(s.GetService<IBotTelemetryClient>(), true));

I am using the power bi template given by the Microsoft from below link.
https://microsoft.github.io/botframework-solutions/solution-accelerators/tutorials/view-analytics/3-open-template/

What are the steps to reproduce this issue?

Create a new project using the Virtual Assistant template and enable directline channel.
Do some conversations through chatbot using directline/webchat.
Create a power bi report using a power bi template.

What were you expecting to happen?

Telemetry should store every field value so it will help to create the dashboard.

Can you share any logs, error output, etc.?

Any screenshots or additional context?

image
image

@UtkarshSinghal17 UtkarshSinghal17 added Needs Triage Needs to be triaged for assignment Type: Bug Something isn't working labels Nov 25, 2020
@Batta32
Copy link
Collaborator

Batta32 commented Nov 25, 2020

Hi @UtkarshSinghal17, thanks for reporting this issue.

We will be reviewing the problem and we will let you know any update in this thread 😊.

@UtkarshSinghal17
Copy link
Author

@Batta32 Please find additional information.
I am using Microsoft.Bot.Solution 1.0.1 version.

@dawwa
Copy link

dawwa commented Nov 25, 2020

@UtkarshSinghal17 ,
Not necessarily the root cause of your issue, but one thing that might be worthy to check is the version of the Microsoft.ApplicationInsights.* series nuget packages, try 2.12.0 if this is not what you have and see if that works, as I recently observed the Telemetry is not flowing with any higher version.

@UtkarshSinghal17
Copy link
Author

@dawwa I already have the same version.

@hcyang hcyang added customer-reported Issue is created by anyone that is not a collaborator in the repository. Bot Services Required for internal Azure reporting. Do not delete. Do not change color. labels Nov 26, 2020
@hcyang hcyang assigned dawwa and unassigned dawwa Nov 26, 2020
@tonyanziano
Copy link

@peterinnesmsft / @Batta32 please provide an update if possible.

@Batta32
Copy link
Collaborator

Batta32 commented Dec 1, 2020

Hi @tonyanziano, we are currently working on this issue trying to reproduce the problem. As soon as we have any update, we will back here with the new information 😊.

@munozemilio munozemilio added the Team: Kobuk This issue is assigned to the Kobuk team. label Dec 1, 2020
@Batta32
Copy link
Collaborator

Batta32 commented Dec 2, 2020

Hi @UtkarshSinghal17, we were not able to reproduce the issue.

We came up with some questions:

  1. What version of Power BI are you using? We recommend to use the latest version 2.87.1061.0 32-bit (November 2020)
  2. Are you using the application-insights id as this document describes?

Our environment:

  • C# Virtual Assistant
  • Direct Line Channel Enabled
  • Power BI Desktop version 2.87.1061.0 32-bit (November 2020)
  • Direct Line Sample

We followed these steps:

  1. Apply code lines you provided
  2. Deploy the bot using deploy.ps1 script
  3. Enable Direct Line Channel in the bot
  4. Open the Power BI report
  5. Provide the application-insights id
  6. Talk with the bot in the Direct Line Channel
  7. Refresh the Power BI report
  8. See the results in the Power BI report

Furthermore, we followed these documents as guide:

We will be attentive to your answer 🙂.

Telemetry showing in Power BI report
image

@UtkarshSinghal17
Copy link
Author

UtkarshSinghal17 commented Dec 2, 2020

Hello @Batta32 Please find screenshots for my power bi version and also I have used application-insight same as described in the document.

image008
image009
Power BI version

@hcyang hcyang added customer-replied-to Indicates that the team has replied to the issue reported by the customer. Do not delete. and removed Needs Triage Needs to be triaged for assignment labels Dec 2, 2020
@Batta32
Copy link
Collaborator

Batta32 commented Dec 2, 2020

Hi @UtkarshSinghal17, we successfully reproduced the issue filtering the ConversationId column by the blank value as you appear to have filtered here.

Can you verify if you have any active filter in your query? We have attached the query.txt
that you can use in your Power BI which is the one of the template.

Finally, we noticed that you correctly received data in your report as you have 11 Users and 197 Messages here.

We will be attentive to your answer 🙂.

Issue reproduced
image

Before/After of the query with the applied filter
image

@UtkarshSinghal17
Copy link
Author

I have deployed chatbot to different app service and pointing to different application Insights Now I am able to retrieve all data except Hero Card, Adaptive Card text. Is it any way I can get text/title/button values in the power bi report?

@Batta32
Copy link
Collaborator

Batta32 commented Dec 11, 2020

Great @UtkarshSinghal17 ! We will be reviewing the scenario of populating the values of a card in the Power BI report and as soon as we have any update, we will back to you here 😊.

@Batta32
Copy link
Collaborator

Batta32 commented Dec 14, 2020

Hi @UtkarshSinghal17, there is a way to do what you need and we found the same issue described in #3447 (check comment). However, it's not ideal and hopefully you can adapt it to better suit your needs.

Follow these steps:

  1. In the Power BI report, click on Transform Data from the Home tab

  2. Click on EventTelemetry, and then click on Advanced Editor

  3. Add this line to the query, and click Done

    Card_Text = (parse_json(tostring(parse_json(customDimensions.attachments))))[0].content['text']
    

    image

  4. Now go to the Interactions table, and change line 7:

    #"Added BotMessageText Column" = Table.AddColumn(#"Added OperationID Column", "BotResponseText", each if [EventName] = "BotMessageSend" then (if [Card_Text]<>null then [Card_Text] else [Title]) else null)
    

    image

  5. Click Done. A new column Card_Text should appears as follows:
    image

Let us know if this helps you 😊

@UtkarshSinghal17
Copy link
Author

Thanks @Batta32 .

It is really helpful. I am able to get all the data that I required.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bot Services Required for internal Azure reporting. Do not delete. Do not change color. customer-replied-to Indicates that the team has replied to the issue reported by the customer. Do not delete. customer-reported Issue is created by anyone that is not a collaborator in the repository. Team: Kobuk This issue is assigned to the Kobuk team. Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

8 participants