使用 Application Insights 对我的 Azure 服务器的使用分析限制

Usage analytics limitations for my azure server using Application Insights

我已经构建了一个网络 API,它接收 GET 请求并根据传入的规范处理图像,例如图像 Url、要在其上绘制的文本、质量、大小等。

我有几个关于使用 Application Insights 的问题,它似乎内置在我的 Visual Studio IDE 和 Azure 中。在我的研究中查看此来源后引发了这个问题使用分析的正确形式:

https://docs.microsoft.com/en-us/azure/application-insights/app-insights-overview

问题:

1) 是否需要使用任何新代码?

2) 它能否跟踪各个参数(图像、大小等),以便我们可以看到,例如,最常使用哪些图像、请求的图像大小等?

3) 我们是否也可以使用它来记录未完全映射到单独方法或 api 端点的自定义事件? (例如,记录我们每次绘制文本字段、测量字符串、加载字体或从 blob 存储中提取图像的时间)

我真的很感激一个答案,它可以涵盖我更广泛的担忧,比如这些关于选择使用分析工具的担忧。关于 Azure 有哪些其他工具可以满足这些要求的任何建议也很好。

感谢您抽空阅读!

关于第一个问题,答案是:视情况而定。您的网站 api 如何以及在何处托管。在 IIS 中?在 Azure 上?使用自托管?

根据此处找到的文档https://docs.microsoft.com/en-us/azure/application-insights/app-insights-monitor-performance-live-website-now这些是您的选择:

You can instrument a live web app with Azure Application Insights, without having to modify or redeploy your code. In your apps are hosted by an on-premises IIS server, you install Status Monitor; or if they're Azure web apps or run in an Azure VM, you can install the Application Insights extension. (There are also separate articles about instrumenting live J2EE web apps and Azure Cloud Services.)

但是当涉及到您的其他问题时,您将需要使用SDK 添加一些代码。然后,您可以跟踪自定义跟踪(例如日志消息)、自定义指标(例如图像大小的计数)。见 https://docs.microsoft.com/en-us/azure/application-insights/app-insights-api-custom-events-metrics:

The Azure Application Insights core telemetry API lets you send custom events and metrics, and your own versions of standard telemetry. This API is the same API that is used by the standard Application Insights data collectors.

使用此 SDK,您可以在事件定义提供的属性旁边向您收集的任何遥测项目添加自定义属性。

现在,AI 不仅会为您呈现一个仪表板,让您快速了解您的应用状态,它还有一个非常强大的查询工具,您可以使用:https://docs.microsoft.com/en-us/azure/application-insights/app-insights-analytics

所以是的,我会说你描述的一切都可以用人工智能来完成。既然你可以免费使用它,我会说试一试,因为得到它并且 运行 很容易。