Application Insights 显示在实时指标中,但不显示在日志分析中

2024-03-04

So I created a Class library that configures microservices's Application Insights. These are the Application Insights configuration methods: enter image description here

And this is how I use them in the Startup.cs class of each microservice: enter image description here

It seems to be working fine, according to the debug logs: enter image description here

I am even able to see the live metrics in azure correctly: enter image description here

但是,数据不会在 Log Analytics 中“保存”,因此我无法对数据运行任何查询(它始终返回 0 个结果)。

I thought that this could probably be because of the following code in the Program.cs of each microservice: enter image description here I thought that maybe the application insights logger was not configured correctly (not explicitely setting the instrumentation key). However, I tried to set the instrumentation key of the TelemetryConfiguration to the hardcoded Instrumentation Key, but it did not do anything.

我确实阅读了这个文档:https://learn.microsoft.com/en-us/azure/azure-monitor/app/asp-net-core https://learn.microsoft.com/en-us/azure/azure-monitor/app/asp-net-core但我似乎没有错过任何步骤(我称之为 AddApplicationInsights 和 AddApplicationInsightsKubernetesEnricher)。

我想知道是否有人可以看到这个问题,我真的不知道如何通过实时指标而不是 Log Analytics 查看数据。

注意:在使用完全相同的代码(当您使用 VS 时生成的默认代码)实现库之前,我确实尝试添加应用程序见解right click on project > Setup Application Insights它工作得很好。

非常感谢!


以下是针对可能也有同样问题的其他人的总结:

正如 Dmitry 提到的,vs 输出中的正确格式应该是Microsoft.ApplicationInsights.Dev.GUID, not Microsoft.ApplicationInsights.Dev.instrumenationkey=GUID。以下是正确截图:

根据 op 的评论,在 keyvault 中,只需将连接字符串复制粘贴到 keyvault 中,而不是导致此错误的检测密钥。解决方案是直接在keyvault中将其更改为instrumentation key。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Application Insights 显示在实时指标中,但不显示在日志分析中 的相关文章

随机推荐

  • Binary(16) 字段截断 Guid 的尾随零

    在 C 中 我有一个byte 名为 UniqueId 的字段 我将此字段作为 Binary 16 存储在 SQL Server 数据库 EF6 中 我注意到有时 存储的 guid 是 15 个字节而不是 16 个字节 当我这样做时 这会导致
  • 从月份名称获取月份编号?

    快速问题 我有一个按名称列出的月份列表 即 Jan Feb Mar Apr 等 我想将其转换为 1 2 3 4 等 我已经写了一些简单的代码可以做到这一点 但只是好奇是否有人知道使用任何 API 来做到这一点的方法 快速回答 NSDateF
  • Memcached 使用超过最大内存

    我在 memcache 上安装了一个安装程序 我想在生产环境中使用它 但是当我运行了一些测试时 似乎 memcache 不会释放内存 即使它用完了所有分配的内存 我也登录了并运行了flush all命令 但对象仍在缓存中 这是一些测试的输出
  • 使用 CreateProcessAsUser 启动 url

    最近我遇到了一个问题 我需要从提升的应用程序打开网页 我需要以非提升方式打开浏览器 所以我环顾四周 发现这个解决方案 https stackoverflow com a 287072 127602 这肯定会解决我的问题 除了CreatePr
  • windows批处理文件eq此时出乎意料

    我正在编写一个 Windows 批处理脚本来安装服务 首先 我需要查找该服务是否已经存在 如果服务存在 它必须检查状态 如果状态正在运行 则必须停止并删除服务 这是我的代码 test bat 我正在从命令行运行它 for F tokens
  • 操作栏中的自定义主页图标 Sherlock

    我正在尝试使用设置主页图标的自定义图标ActionBarSherlock 库 http actionbarsherlock com 我尝试使用设置自定义布局abHomeLayout我的自定义主题中的属性 但这对我不起作用 唯一的方法 如何设
  • FieldValue.increment 不起作用,但添加“操作数”

    我正在使用 firebase 数据库和一个带有新功能的简单函数FieldValue increment https firebase google com docs reference js firebase firestore Field
  • 在 JavaScript 中执行继承

    现在 虽然我知道您不能像在 C 中那样执行继承 但我在互联网上看到它提到这是可能的 如果无法使用纯 JavaScript 代码 那么是否可以使用Ext JS http en wikipedia org wiki Ext JS如果是这样怎么办
  • 伊莎贝尔的文件准备

    我想获得与相关的 LaTeX 代码这个理论 https github com rjraya Isabelle blob master curves Hales thy 以前的答案仅提供文档的链接 让我描述一下我做了什么 我去了目录Hales
  • Eclipse PDT 插件安装

    我尝试在 Eclipse 中安装 PDT 插件 但出现错误 Cannot complete the install because one or more required items could not be found Software
  • Firebase 身份验证 - 过期的 api 密钥

    我正在开发一个无服务器客户端应用程序 它使用 Firebase 身份验证和 Google 的其他服务 一切都很顺利 突然 FB 登录身份验证停止工作 当尝试登录用户时 我会收到一个 400 BADREQUEST 其正文如下 error co
  • 使用 Socket.IO 发送数据的频率是多少?

    我正在创建一个 Web 应用程序 需要频繁地将少量数据 每个套接字 3 个整数值 从服务器发送到客户端 并且我想看看是否有使用更新客户端的最大频率套接字IO https socket io 我希望能够实现至少 50 个套接字连接 每个连接每
  • 在Delphi XE2上使用MSBuild编译运行时包时出现编译错误

    我正在将我们的构建服务器 Jenkins 升级到Delphi XE2 编译运行时包时出现以下错误 ComponentsR vrc 61 error RC2135 file not found ComponentsR Icon4 ico 此运
  • drawViewHierarchyInRect:afterScreenUpdates: 延迟其他动画

    在我的应用程序中 我使用drawViewHierarchyInRect afterScreenUpdates 为了获得我视野中的模糊图像 使用AppleUIImage类别UI图像效果 https developer apple com do
  • 如何检测 WebView 页面何时尝试关闭?

    我有一个 WebView 我正在其中加载 facebook sharer php 页面 此页面没有任何形式的确认 它只是在用户共享或取消后关闭窗口 由于它被加载到网络视图中 因此本身没有什么可以 关闭 的 因此 我需要检测尝试关闭的窗口并对
  • 预压缩的 gzip 在 Chrome 上崩溃,为什么?

    我在我的网站上提供预压缩的 CSS 和 JS 文件 以及 IE6 8 和 FF 与我的 htaccess 文件完美配合 Compressed files RewriteCond HTTP Accept Encoding gzip AddEn
  • 将库从 Java 移植到 Python

    我即将将一个小型库从 Java 移植到 Python 并需要一些建议 小型 几千行代码 我研究了一点 Java 代码 并注意到两种语言中常见的一些设计模式 然而 肯定存在一些仅适用于 Java 的习惯用法 单例等 这些习惯用法在 Pytho
  • 传单测量转换的精确度

    map layerPointToLatLng map latLngToLayerPoint L latLng 40 687 73 9035 结果是 纬度 40 686886382151116 经度 73 90228271484375 不精确
  • 为什么我需要在setup.py中包含子包

    我有一个名为的 python 包mltester其中包含两个子包 actions dialogs 和一个主脚本ml tester py 结构如下
  • Application Insights 显示在实时指标中,但不显示在日志分析中

    So I created a Class library that configures microservices s Application Insights These are the Application Insights con