microsoft / sample-app-aoai-chatGPT

Sample code for a simple web chat experience through Azure OpenAI, including Azure OpenAI On Your Data.
MIT License
1.44k stars 2.15k forks source link

How to help identify and track user by using App Insights #861

Open qzhang25 opened 1 month ago

qzhang25 commented 1 month ago

Hi there, currently we are using Application Insight to track the End-to-end transaction details We realized that the user_id has value but we still don't know how to identify users based on the value it provided. 2024-05-20_11-31-28

Is there way in the code we can edit so that we can replace the user_id value into other value such as username or user_email?

Thanks,

abhahn commented 1 month ago

Hi @qzhang25 , we currently don't have Application Insights implemented as a common integration in the webapp, so there isn't much we can do to support this at this time.

We are considering adding this integration in the near future though, so if this is something you'd like to contribute to the repo you are welcome to open up a PR so share this integration with the community. It would be easier for us to conceptualize enhancements such as this if the common integration were in place.

In the meantime, I would recommend checking out the docs for Application Insights to see if there is some middleware you can activate to include custom properties.