你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

管理 Azure Monitor 工作区

本文介绍如何创建和删除 Azure Monitor 工作区。 配置适用于 Prometheus 的 Azure Monitor 托管服务时,可以选择现有的 Azure Monitor 工作区或创建新的工作区。

注意

创建 Azure Monitor 工作区时,MA_<azure-monitor-workspace-name>_<location>_managed 形式的资源组中默认自动创建 <azure-monitor-workspace-name> 形式的数据收集规则和数据收集终结点。

创建 Azure Monitor 工作区

  1. 在 Azure 门户中打开“Azure Monitor 工作区”菜单。

  2. 选择创建

    Screenshot of Azure Monitor workspaces menu and page.

  3. 在“创建 Azure Monitor 工作区”页上,选择要在其中创建工作区的“订阅”和“资源组”。

  4. 提供工作区的名称和区域。

  5. 选择“查看 + 创建”以创建工作区。

创建 Azure Monitor 工作区时,会创建新的资源组。 资源组名称采用以下格式:MA_<azure-monitor-workspace-name>_<location>_managed,其中已标记化元素采用小写。 资源组包含一个数据收集终结点,以及一套与工作区同名的数据收集规则。 删除工作区时,会自动删除资源组及其资源。

若要将适用于 Prometheus 的 Azure Monitor 托管服务连接到 Azure Monitor 工作区,请参阅从 AKS 群集收集 Prometheus 指标

删除 Azure Monitor 工作区

删除 Azure Monitor 工作区时,与 Log Analytics 工作区不同的是,不会执行软删除操作。 工作区中的数据会立即删除,并且没有恢复选项。

  1. 在 Azure 门户中打开“Azure Monitor 工作区”菜单。

  2. 选择工作区。

  3. 选择“删除”。

    Screenshot of Azure Monitor workspaces delete button.

将 Azure Monitor 工作区连接到 Azure 托管 Grafana 工作区,以允许 Grafana 在 Grafana 仪表板中使用 Azure Monitor 工作区数据。 Azure Monitor 工作区可以连接到多个 Grafana 工作区,而 Grafana 工作区可以连接到多个 Azure Monitor 工作区。

注意

将 Azure Monitor 工作区作为数据源添加到 Grafana 时,它将以 Managed_Prometheus_<azure-monitor-workspace-name> 的形式列出。

  1. 在 Azure 门户中打开“Azure Monitor 工作区”菜单。
  2. 选择工作区。
  3. 选择“链接的 Grafana 工作区”。
  4. 选择 Grafana 工作区。

如果 Grafana 实例是自托管的,请参阅使用托管系统标识将 Azure Monitor 适用于 Prometheus 的托管服务用作自托管 Grafana 的数据源

常见问题

本部分提供常见问题的解答。

是否可以在与 Azure Monitor 工作区和适用于 Prometheus 的托管服务不同的区域中使用 Azure 托管 Grafana?

是的。 当使用适用于 Prometheus 的托管服务时,可以在任何受支持的区域中创建 Azure Monitor 工作区。 你的 Azure Kubernetes 服务群集可以位于任何区域,并将数据发送到不同区域中的 Azure Monitor 工作区。 Azure 托管 Grafana 也可以不位于创建 Azure Monitor 工作区的区域。

后续步骤