Azure WebJobs 和队列相关指标

标签 azure azure-webjobs azureportal

我浏览了Azure门户并搜索了网络,但我一直无法找到答案。有没有办法(也许通过 api 或 powershell)来获取 webjobs 的指标?例如每个工作的平均运行时间?我还想找出网络作业触发的消息的平均排队时间(尽管这可能是存储指标而不是网络作业指标)。任何指示将不胜感激。

最佳答案

正如 Igorek 所说,我认为这也是不可能的。有很多工具可以监控应用程序。其中两个具有 Azure 集成:

我已使用 Application Insights 从 Web 作业发送指标。您可以按照本教程在您的网络作业中设置应用程序洞察:

如果你想计算处理队列中消息的时间,你可以这样做:

public async Task ProcessAsync([ServiceBusTrigger("queueName")] BrokeredMessage incommingMessage)
{
    var stopwatch = Stopwatch.StartNew();

    // Process your message
    ...

    stopwatch.Stop();

    // You should only instantiate the TelemetryClient once in your application.
    var telemetryClient = new TelemetryClient() { InstrumentationKey = "MyInstrumentationKey"};

    //Send your metric
    telemetryClient.TrackMetric("ProcessQueueMessageElapsedTime", stopwatch.ElapsedMilliseconds);
}

关于Azure WebJobs 和队列相关指标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36140174/

相关文章:

node.js - Azure Web应用程序 Node 部署,更改应用程序根目录?

azure - 如何为 Azure 上的网站预览选择 Windows Server 2012

c# - 禁用 "azure-jobs-host-output"/"azure-webjobs-hosts/output-logs"消息

azure - 如何找到创建空 WADMetrics 表的 Azure 资源或设置?

azure - 了解 Azure PaaS 指标

使用 puppeteer 访问 Azure UI : login with service principal

azure - 通过 YAML 发布管道运行 azure powershell 脚本

azure - 将 URL 参数从 Azure ACS 传递到我的自定义身份提供程序?

c# - azure webjob 停止并出现未处理的异常 : 503 Server Unavailable

azure - 当计划的 WebJob 长时间运行时会发生什么