azure - AppInsights - 监控挂起的进程
问题描述
我们正在考虑为我们的非 Web 应用程序实施 AppInsights。我们要监视的一件事是可能“挂起”超过 N 秒或分钟的进程。我一直无法找到内置的东西来做到这一点。我见过或想到的最接近的事情是为进程的开始和结束记录 2 个自定义事件,然后对自定义日志发出警报,该日志在 N 分钟后查询没有匹配的“结束”事件的事件。
是否有另一种方法可以使用我没有看到的 AppInsights 监控挂起的进程?谢谢你的帮助。
解决方案
如果您选择使用应用洞察,这里的建议仅供您参考(但如果您有其他更好的解决方案,您可以忽略此):
根据这篇文章,您可以利用心跳功能,详细信息如下:
if this application runs more than several seconds, you can leverage heartbeat
feature - it sends metric every N minutes/seconds (configurable) and the absence of such
metric will indicate that application is no longer actively running. However, if
Application Insights thread survives, then heartbeat will still be reported.
You can rely on presense/absense of the telemetry from this app in general as well as
couple custom events as you outlined above - Azure Monitor allows to set an alert on
analytics query, so you'll be able to craft a query that returns nothing in case of
application issues and set an alert on 0 count returned by such a query.
推荐阅读
- php - Yii2 - 生成的密码哈希每次都不同
- javascript - 将另一个js文件中的变量导入新的js文件React
- android - 如何为布尔变量创建监听器?
- css - 我将在 CSS 中使用哪个选择器来制作 Buddypress 用户个人资料图像?
- r - 在某些条件下比较 R 中的两个 CSV 文件
- php - PHP致命错误:未捕获的Swift_TransportException:无法与主机ssl://smtp.gmail.com建立连接:stream_socket_client()
- javascript - 页面提交状态不会改变
- excel - 如何找到在子菜单中单击的控制按钮
- python - 如何在 Python 中实现相同的概念?
- c# - 代码优先方法实体框架抛出异常索引超出了数组的范围