如何在 Azure Function App 中禁用自适应采样

问题描述 投票:0回答:0

我有一个用 Node.js 14 编写的 Azure Function App。我需要将“EnableAdaptiveSampling”设置为 false,但我不知道在哪里可以找到这个参数。

在阅读了许多其他 StackOverflow 问题后,我似乎可以在“appsettings.json”文件或 ConfigureServices 方法 (.cs) 或“ApplicationInsights.config”文件中禁用此参数。

这里有一些其他的StackOverflow类似问题,其中经常指定一个名为“startup.cs”的文件,但不清楚这个文件的位置和用途:

链接 1

链接 2

链接 3

我不知道这些信息是否有用,但我的 Azure 基础设施以及 Application Insights 都是通过 Terraform 部署的。

现在,在我的项目文件夹中,我找到了 Terraform 文件和功能应用程序脚本,我没有看到任何“appsettings.json”、“ApplicationInsights.config”文件或 general.cs“文件,那里只是 Function App 文件夹中名为“host.json”的文件,如下所示:

{
  "version": "2.0",
  "logging": {
    "applicationInsights": {
      "samplingSettings": {
        "isEnabled": true,
        "excludedTypes": "Request"
      }
    }
  }

我在其中看到与我的函数应用程序采样相关的内容,但我没有看到自适应采样选项。

在下面,我的问题列表:

  1. 我在哪里可以找到“appsettings.json”文件?
  2. 我在哪里可以找到“.cs”文件?
  3. 在哪里可以找到“ApplicationInsights.config”文件?
  4. 如果我在 host.json 文件中将
    samplingSettings
    设置为 false,我是否也禁用自适应采样?

这里是我读过的一些 Azure 文档的列表:

如何为 Azure Functions 配置监控

Application Insights 中的抽样

但是在阅读本文档后,我仍然不清楚在哪里可以找到这些文件以及如何禁用自适应采样。

node.js azure azure-functions azure-application-insights azure-monitoring
© www.soinside.com 2019 - 2024. All rights reserved.