使用QnA maker和Bot Framework版本sdk3.0在Web应用程序bot构建的遥测中设置用户上下文ID [英] Set user context ids in telemetry for web app bot build using QnA maker and Bot Framework version sdk3.0

查看:70
本文介绍了使用QnA maker和Bot Framework版本sdk3.0在Web应用程序bot构建的遥测中设置用户上下文ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们使用QnA maker和Bot framework sdk 3.0创建了Web App BoT。

We have created Web App BoT using QnA maker and Bot framework sdk version 3.0.

我们在Azure上启用了针对QnA制造商服务的Application Insight,在Web App bot页面中,我添加了以下java脚本代码行。

We have enable Application Insight for QnA maker service on Azure, in Web App bot page, i have added below line of java script code.

< script type =" text / javascript">

var appInsights = window.appInsights || function(a){

  ; function b(a){c [a] = function(){var b = arguments; c.queue.push(function(){c [a] .apply(c,b)})}} var c = {config :a},d = document,e = window; setTimeout(function(){var b = d.createElement(" script"); b.src = a.url ||" https://az416426.vo。 msecnd.net/scripts/a/ai.0.js",d.getElementsByTagName("script")[0].parentNode.appendChild(b)});try{c.cookie=d.cookie}catch(a ){} c.queue = []; for(var
f = [" Event"," Exception"," Metric"," PageView"," Trace"," Dependency"]; f.length;)b("跟踪" + f.pop());如果(b(" setAuthenticatedUserContext"),b(" clearAuthenticatedUserContext"),b(" startTrackEvent"),b(" stopTrackEvent" ;),b(" startTrackPage"),b(" stopTrackPage"),b("冲洗"),! a.disableExceptionTracking){F ="的onerror",b(" _" + F); var
g = e [f]; e [f] = function(a,b,d,e,h){var i = g&& g(a,b,d,e,h); return !0!== i&& c [" _" + f](a,b,d,e,h),i}}返回c
  }({

    instrumentationKey:" XXXXXXXXXXXXXXXXXXXXXXXX"

 });



window.appInsights = appInsights,appInsights.queue&& 0 === appInsights.queue.length&& appInsights.trackPageView();
$
window.appInsights.setAuthenticatedUserContext(" jatin1111" ,"jatin333333";;


< / script>

<script type="text/javascript">
var appInsights=window.appInsights||function(a){
  function b(a){c[a]=function(){var b=arguments;c.queue.push(function(){c[a].apply(c,b)})}}var c={config:a},d=document,e=window;setTimeout(function(){var b=d.createElement("script");b.src=a.url||"https://az416426.vo.msecnd.net/scripts/a/ai.0.js",d.getElementsByTagName("script")[0].parentNode.appendChild(b)});try{c.cookie=d.cookie}catch(a){}c.queue=[];for(var f=["Event","Exception","Metric","PageView","Trace","Dependency"];f.length;)b("track"+f.pop());if(b("setAuthenticatedUserContext"),b("clearAuthenticatedUserContext"),b("startTrackEvent"),b("stopTrackEvent"),b("startTrackPage"),b("stopTrackPage"),b("flush"),!a.disableExceptionTracking){f="onerror",b("_"+f);var g=e[f];e[f]=function(a,b,d,e,h){var i=g&&g(a,b,d,e,h);return!0!==i&&c["_"+f](a,b,d,e,h),i}}return c
  }({
      instrumentationKey:"XXXXXXXXXXXXXXXXXXXXXXXX"
  });

window.appInsights=appInsights,appInsights.queue&&0===appInsights.queue.length&&appInsights.trackPageView();
window.appInsights.setAuthenticatedUserContext("jatin1111","jatin333333");

</script>

我在日志中收到用户,会话等,但是我想要详细级别日志,例如用户ID明智问题要求BoT等。

I am getting Users, sessions etc in logs, but i want details level logs like user ids wise questions asked to BoT etc.

同样,我去了Application Insights - >概述 - >分析仪 - >架构 - >跟踪和运行查询,但它给我空白用户ID。

For same, i have go to Application Insights -> Overview -> Analyzer -> Schemas -> traces and run query, but it gives me blank user id.

我还浏览了链接  表示我需要设置用户ID,但我无法找到Web App BoT我需要编写此代码。

I have also browse link  which indicate i need to set user ids, but i am not able to find for Web App BoT where i should i need to write this code.

推荐答案

您好  Jatin

感谢您的联系!

是的,您可以从应用程序启用详细日志记录,并通过帮助将其提取到Application Insights实例&absp; 应用
用于自定义事件和指标的Insights API
,可让您发送自定义遥测。

Yes, you can enable detailed logging from your application and pump it to your Application Insights instance with the help of Application Insights API for custom events and metrics, which would enable you to send custom telemetry.

此外,您始终可以控制和自定义如何捕获和处理遥测信息使用  遥测
初始化器和遥测处理器

Also, you can always control and customize how telemetry is captured and processed before it is sent to the Application Insights service using Telemetry Initializers and Telemetry Processors.

请参阅以下博客以深入了解实施:

Please refer to the following blogs to get a deeper insight into the implementation:

请查看并查看如果以上适合你的话!希望这有帮助!

Please check and see if the above works for you! Hope this helps!


这篇关于使用QnA maker和Bot Framework版本sdk3.0在Web应用程序bot构建的遥测中设置用户上下文ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆