Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AppInsights Integration should send up Teams channel info, and AAD app id. and make user_id more clear #5855

Closed
8 tasks done
msftjayongg opened this issue Apr 1, 2020 · 5 comments
Assignees
Labels
BF Customer Ask "Convenience" asks made by our customers and don’t accrue to any major feature P1 Painful if we don't fix, won't block releasing R10 Shipping 2020-08-17

Comments

@msftjayongg
Copy link

msftjayongg commented Apr 1, 2020

Is your feature request related to a problem? Please describe.
For users to make the most use out of the telemetry, there are important metrics that should be transmitted into the customEvents in ApplicationInsights. Without making the developer do more work. Right now the lack of clarity with the user_id metric lets ISVs overcount. (I've double checked application insights telemetry)

Describe the solution you'd like
We should add two fields and fix up the user_id field

  1. TenantID. A lot of ISVs track not just user counts, but also tenant counts. We should put this information into the custom event. This information is available in the turnContext.
  2. Teams Channel information - in short, "is this a channel" or "is this a a user?".
  3. User_id - in AppInsights, I see two types of users. Some begin with "msteams29:", and some begin with "a:". I suspect this relates to Trace from a Bot does not show up in the Emulator botbuilder-dotnet#2, as some are channel thread ids, and some are user ids. Not quite sure TBH. The user_id to actually count real users. (I can log a separate issue on this if needed)

Describe alternatives you've considered
Developer can work around this by logging the data herself. However this belongs in the framework - else we're just making more calls to Application Insights unnecessarily.

Dotnet SDK 4255

  • PR
  • Merged

Javascript SDK 2523

  • PR
  • Merged

Python SDK 1246

  • PR
  • Merged

Java SDK 691

  • PR
  • Merged
@mrivera-ms mrivera-ms transferred this issue from microsoft/botbuilder-dotnet May 21, 2020
@mrivera-ms mrivera-ms added BF Customer Ask "Convenience" asks made by our customers and don’t accrue to any major feature R10 Shipping 2020-08-17 labels May 21, 2020
@cleemullins cleemullins added Bot Services Required for internal Azure reporting. Do not remove. 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. labels May 21, 2020
@cleemullins
Copy link
Contributor

This is a great feature ask. We're planning to take this in our R10 release (which is our next milestone).

@cleemullins cleemullins removed Bot Services Required for internal Azure reporting. Do not remove. 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. labels May 21, 2020
@clearab clearab added the teams label May 21, 2020
@clearab clearab added P1 Painful if we don't fix, won't block releasing and removed R10 Shipping 2020-08-17 labels Jun 10, 2020
@gabog gabog added this to the R10 milestone Jun 15, 2020
@gabog gabog added the R10 Shipping 2020-08-17 label Jun 24, 2020
@garypretty
Copy link
Contributor

Hi @msftjayongg - I have been looking into how we can address this feature request.

Firstly, I serialized the channel data I received in different circumstances to understand what we might log to assist.

1:1 Chat with the bot

{"tenant":{"id":"XXXXXX-XXXX-XXXX-XXXX-XXXXXXX"}}

Group Chat

{"tenant":{"id":"XXXXXX-XXXX-XXXX-XXXX-XXXXXXX"}}

Message via a Channel

{"teamsChannelId":"19:e05xxxxxxxxxxxxxxxxxxxxx4f800e@thread.tacv2","teamsTeamId":"19:e05xxxxxxxxxxxxxxxxxxxxx4f800e@thread.tacv2","channel":{"id":"19:e05d7a1fa66646a9bee7ed47c34f800e@thread.tacv2"},"team":{"id":"19:e05xxxxxxxxxxxxxxxxxxxxx4f800e@thread.tacv2"},"tenant":{"id":"XXXXXX-XXXX-XXXX-XXXX-XXXXXXX"}}


So, to respond to your points.

  1. Tenant ID - we get this every time, so we can add this to the custom event properties

  2. Channel vs User - if you're in a chat (1:1 or group - but both under the chat tab) - the channel info object is null. If the bot is receiving a message from a channel, then the channel data is populated. In this case, we should be able to log the team / channel ID. Thus, the presence of this within the event data will tell you if this is user chat vs channel.

  3. The User ID, during my testing was always in the format "29:..............................", so I do not know where the "a:" user came from (I have asked internally to try and find out) - can you reliably repro?. However, in the case of some channels, the user ID alone may not be enough to determine the unique user count and you will need to use a mixture of information at times to understand the unique user count better, which you should be able to get once we log the additional information.

Do the additional data points I have suggested we log make sense to you? If so I can work up a PR to capture the additional data.

@garypretty
Copy link
Contributor

Agreed with Tatiana in Teams that, as per the above, we will add the following items to our telemetry is the user is using the Teams channel.

  • Tenant Id
  • AAD Id (need to confirm, but I believe this may already be captured as part of user information.)
  • TeamInfo, if available

@msftjayongg
Copy link
Author

Hi Gary,

Sorry I didn't see your message from 13 days ago. I think your comments make sense. I don't know where the "a:" come from, did Tatiana have a response to that, seems like she would know.

@tacri
Copy link

tacri commented Jul 10, 2020

For the point 3 above, a: prefix is usually for 1:1 conversations between the user and the bot. If there is a repro we can confirm what is happening from our logs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BF Customer Ask "Convenience" asks made by our customers and don’t accrue to any major feature P1 Painful if we don't fix, won't block releasing R10 Shipping 2020-08-17
Projects
None yet
Development

No branches or pull requests

7 participants