gpt4 book ai didi

azure - 将 Application Insights 作为 Azure 应用服务扩展安装还是通过 NuGet 安装?

转载 作者:行者123 更新时间:2023-12-04 18:21:05 25 4
gpt4 key购买 nike

可以通过 Azure 应用服务中的扩展部分安装 Application Insights,但也可以仅通过 NuGet 安装包并定义 APPINSIGHTS_INSTRUMENTATIONKEY 应用程序设置。您也可以两者都做。

有什么区别?

编辑:

我发现安装扩展或 NuGet 包之间有什么区别:

You can configure monitoring by instrumenting the app in either of two ways:

Run-time - You can select a performance monitoring extension when your web app is already live. It isn't necessary to rebuild or re-install your app. You get a standard set of packages that monitor response times, success rates, exceptions, dependencies, and so on.

Build time - You can install a package in your app in development. This option is more versatile. In addition to the same standard packages, you can write code to customize the telemetry or to send your own telemetry. You can log specific activities or record events according to the semantics of your app domain.

来源:https://learn.microsoft.com/en-us/azure/application-insights/app-insights-azure-web-apps#run-time-or-build-time

但是如果你两者都做呢?这样做有什么好处吗?

最佳答案

But what if you do both? Will there be anything beneficial about it?

  • 该扩展程序检测到您的应用已经附带了 Application Insights,并且除了删除探查器(这有助于收集依赖项中的完整 SQL 语句)之外,不会执行任何操作。如果没有探查器,将不会收集完整的 SQL 语句,但其他一切都应该正常工作。(如果您使用的是 2.3.0 或更早版本的 SDK,或者您的应用程序面向旧版 .NET Framework(如 4.0),则探查器也可以更好地关联依赖项。

简而言之,从 SDK 2.4.0 开始,在 nuget 安装之上安装扩展的唯一好处是在依赖项遥测中获取完整的 SQL 语句。

关于azure - 将 Application Insights 作为 Azure 应用服务扩展安装还是通过 NuGet 安装?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49385776/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com