Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/476.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/linq/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 应用程序日志到错误的目标_Javascript_Azure_Monitoring_Azure Application Insights - Fatal编程技术网

Javascript 应用程序日志到错误的目标

Javascript 应用程序日志到错误的目标,javascript,azure,monitoring,azure-application-insights,Javascript,Azure,Monitoring,Azure Application Insights,我有两个网络应用。他们都在视图中添加了App Insights JS SDK 一个是大型web应用程序,另一个是带有一个页面的小型微服务。它们有不同的仪表键 问题是我们在微服务人工智能资源中找到了来自“大应用”的日志。这可能发生在“大应用”中发生错误时,用户重定向微服务页面,然后存在站点或关闭窗口。缓冲区中的所有日志都是使用AI JS SDK从微服务页面发送的,即使它们没有发生在那里 以上只是我的假设,但我看不到任何其他解释。 我不想使用一个人工智能资源,因为应用程序必须单独监控 你有什么办法解

我有两个网络应用。他们都在视图中添加了App Insights JS SDK

一个是大型web应用程序,另一个是带有一个页面的小型微服务。它们有不同的仪表键

问题是我们在微服务人工智能资源中找到了来自“大应用”的日志。这可能发生在“大应用”中发生错误时,用户重定向微服务页面,然后存在站点或关闭窗口。缓冲区中的所有日志都是使用AI JS SDK从微服务页面发送的,即使它们没有发生在那里

以上只是我的假设,但我看不到任何其他解释。 我不想使用一个人工智能资源,因为应用程序必须单独监控


你有什么办法解决这个问题吗?或者可能有不同的原因?

如果您使用的是最新版本的Application Insights,则可以在配置中指定
名称前缀。这将使用此字符串作为所有cookie/sessionstorage/localstorage键的前缀,以便它们不会与SDK的其他实例冲突

从'@microsoft/ApplicationInsights-web'导入{ApplicationInsights}
const appInsights=新应用程序目录({config:{
instrumentationKey:“您的插入键在这里”,
名称前缀:“我的应用程序”
} });
appInsights.loadAppInsights();

appInsights.trackPageView()
如果您使用的是最新版本的Application Insights,则可以指定
名称前缀作为配置的一部分。这将使用此字符串作为所有cookie/sessionstorage/localstorage键的前缀,以便它们不会与SDK的其他实例冲突

从'@microsoft/ApplicationInsights-web'导入{ApplicationInsights}
const appInsights=新应用程序目录({config:{
instrumentationKey:“您的插入键在这里”,
名称前缀:“我的应用程序”
} });
appInsights.loadAppInsights();

appInsights.trackPageView()你的假设可能是正确的,你应该自己检查以确保没有从“大应用”重定向到小微服务。你的假设可能是正确的,你应该自己检查以确保没有从“大应用”重定向到小微服务。