- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在运行以下简单函数来检查功能应用程序中的监控如何工作。如果我的函数在监视部分(以及随后的应用程序洞察)中返回“400”状态代码,则它将标记执行成功。另外,如果它抛出并捕获错误,仍然标记为成功。如果它抛出错误但没有捕获它,那么它会检测并将其计为错误(但这种情况并不常见,因为在实际应用中,总是需要捕获可能的错误)。
这就是 Azure 函数中的监视方式吗?因此,将执行标记为错误的唯一方法是抛出 Uncaught Error ?!?!
在 Application Insight 中,是否可以根据请求的响应状态代码对请求进行排序?例如,是否可以查看单个函数返回了多少个 500 请求?
module.exports = async function (context, req) {
if (req.query.name || (req.body && req.body.name)) {
context.res = {
body: "Hello " + (req.query.name || req.body.name)
};
} else {
// only if following line is uncommented, it counts the funciton execution as error
// throw new Error('this is a test error')
try {
throw new Error('this is a test error')
} catch (e) {
// in this case, it counts the function execution as successfull
return context.res = {
status: 500,
body: "caught the internal error"
};
}
// in this case, counts the function execution as successfull
return context.res = {
status: 400,
body: "didn't catch the error. Please pass a name on the query string or in the request body"
};
}
};
最佳答案
Is this how monitoring in Azure functions work? So the only way to mark the execution as faulty is to throw an uncaught error?
是的,你说得对,具体可以引用这个issue .
In Application Insight, is there anyway to sort the requests based on their response status code? For example is there anyway to see how many 500 requests has been returned from an individual function?
您可以使用应用程序洞察分析来归档您的目标,编写如下简单查询:
requests
| where name ="your function app name"
| where resultCode =="500 or other status code"
| count
结果如下:
注意:如果您不知道如何导航到应用程序洞察分析,请按照以下步骤操作:
1.在 Azure 门户中导航到您的应用程序见解(与函数应用关联) -> 概述边栏选项卡 -> 在顶部栏上,单击“分析”选项。
关于azure - Azure 在监视功能时将什么视为错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54371350/
我需要记录在网页上执行的事件。 例如。填写登记表。 记录器应捕获关键字条目和在页面上执行的点击,并在请求时回放。同时记录器还应该捕获生成事件的实际元素。说当我在 firstName 中键入 记录器应
我是一个 Jest 新手,我正在为我的 React 应用程序编写单元测试,该应用程序使用 redux 并使用 Typescript 编写。 我的容器组件包含这段代码: const mapDispatc
我想将一些批处理类型的作业从 cron 转移到 Monit,但正在努力让它们正常工作。这些脚本通常每天运行一次,但有时必须在当天晚些时候重新运行。目标是利用 monit 和 m/monit 前端重新运
我正在尝试测试一个组件调用 detectChanges上面注入(inject)了ChangeDetectorRef 我已经逐步完成了代码,它肯定被调用了,但似乎我在组件和测试中得到了不同的 Chang
我想知道是否有一种很好的方法来监视 SharePoint 上的文档库的更改(添加新文件、更改/ checkin 文件、删除文件等) 基本上,什么System.IO.FileSystemWatcher在
是否可以监视 R 正在使用或已用于调用函数的内存量?例如,我有一个任意函数,例如: smallest.sv <- function(){ A <- matrix(rnorm(1e6), 1e3);
这是一个简单的问题,但令人费解...... Azure 服务中是否有统计数据来监控数据工厂被访问的次数? 那么,举个例子,如果一个自动化系统被设置为通过恶意意图耗尽对 ADF 进行持续的 API 调用
Kafka提供了监控当前偏移量和最新偏移量的能力。同样,azure eventhub是否公开任何api来持续监视分区的当前偏移量和最新可用偏移量? 最佳答案 扩展上述答案,您可以看到两种方式的偏移。
是否有系统 View 或 DMV 记录我的数据仓库恢复和暂停的时间以及执行恢复和暂停的帐户?我环顾四周,似乎找不到具有开/关时间戳的 View 。或者甚至是显示放大和缩小的历史时间戳的 View 。
我一直在研究Microsoft Azure 事件中心。我的目标是找到一种提供自动可扩展性的方法。这是一项实验性工作,我实际上只是想知道我可以使用 Azure 事件中心做什么。我无法访问 Azure 平
我有一个在 azure 中运行的辅助角色。 我正在使用标准跟踪诊断,我可以使用 Visual Studio 中的服务器资源管理器查看该诊断。 但是,它很难涉水,速度很慢等等。 谁能推荐一个插件、工具、
我们将 Azure Function 与 Node.js 结合使用。 在Azure门户UI中,在每个函数调用日志列表旁边(在“监视器”选项卡中),我们看到两个计数器:“最近成功计数”和“最近错误计数”
是否有系统 View 或 DMV 记录我的数据仓库恢复和暂停的时间以及执行恢复和暂停的帐户?我环顾四周,似乎找不到具有开/关时间戳的 View 。或者甚至是显示放大和缩小的历史时间戳的 View 。
我一直在研究Microsoft Azure 事件中心。我的目标是找到一种提供自动可扩展性的方法。这是一项实验性工作,我实际上只是想知道我可以使用 Azure 事件中心做什么。我无法访问 Azure 平
我有一个在 azure 中运行的辅助角色。 我正在使用标准跟踪诊断,我可以使用 Visual Studio 中的服务器资源管理器查看该诊断。 但是,它很难涉水,速度很慢等等。 谁能推荐一个插件、工具、
是否可以获取 channel 消息的副本? (而不是从 channel 接收和删除消息) 这个想法是记录一个 channel 的消息。 最佳答案 Is it possible to get copy
我正在尝试使用 Mockito监视路径 em> dirSpy = spy(Files.createTempDirectory(DIR_NAME)); 我收到一条错误消息 Mockito cannot
我的组件具有以下功能: updateTransactions() { let notes = this.createNotes() let delTransactions = th
我想测试一些在 React 组件的 componentDidMount 生命周期方法中调用的自定义方法。 componentDidMount() { getData().then(res
我的 $scope 中有一个对象,其中包含一些属性,例如: $scope.content = { name : 'myname', description : 'mydescrip
我是一名优秀的程序员,十分优秀!