通过 Power BI 直观显示 Azure AI 搜索日志和指标

Azure AI 搜索可以将操作日志和服务指标发送到 Azure 存储帐户,然后你可以在 Power BI 中直观显示这些日志和指标。 本文介绍了相关步骤以及如何使用 Power BI 模板应用来直观显示数据。 该模板可帮助你获取有关你的搜索服务的详细见解,包括有关查询、索引编制、操作和服务指标的信息。

可以在 Power BI 应用市场中找到 Power BI 模板应用“Azure AI 搜索: 分析日志和指标”

设置应用

  1. 为搜索服务启用指标和资源日志记录:

    1. 创建或标识可以将日志存档到其中的现有 Azure 存储帐户

    2. 在 Azure 门户中导航到你的 Azure AI 搜索服务。

    3. 在左侧列中的“监视”部分,选择“诊断设置”

      Screenshot showing how to select Diagnostic settings in the Monitoring section of the Azure AI Search service.

    4. 选择“+ 添加诊断设置”。

    5. 选中“存档到存储帐户”,提供你的存储帐户信息,并选中“OperationLogs”和“AllMetrics”

      Screenshot showing how to make selections for metrics and resource logging in the diagnostic settings page.

    6. 选择“保存”。

  2. 启用日志记录后,使用搜索服务开始生成日志和指标。 需要长达一个小时,包含这些日志的容器才会出现在 Blob 存储中。 你会看到用于搜索流量日志的“insights-logs-operationlogs”容器和用于指标的“insights-metrics-pt1m”容器。

  3. Power BI 应用市场中找到 Azure AI 搜索 Power BI 应用,并将其安装到新的工作区或现有的工作区。 该应用称为“Azure AI 搜索: 分析日志和指标”

  4. 安装该应用后,从 Power BI 的应用列表中选择该应用。

    Screenshot showing the Azure AI Search app to select from the list of apps.

  5. 选择“连接”以连接你的数据

    Screenshot showing how to connect to your data in the Azure AI Search app.

  6. 输入包含你的日志和指标的存储帐户的名称。 默认情况下,该应用将查看过去 10 天的数据,但你可以使用“天数”参数更改此值。

    Screenshot showing how to input the storage account name and the number of days to query in the Connect to Azure AI Search page.

  7. 选择“密钥”作为身份验证方法,并提供你的存储帐户密钥。 选择“专用”作为隐私级别。 单击“登录”,开始加载过程。

    Screenshot showing how to input the authentication method, account key, and privacy level in the Connect to Azure AI Search page.

  8. 等待数据刷新。 这可能需要一些时间,具体取决于你拥有的数据量。 你可以根据下面的指示器查看数据是否仍在刷新。

    Screenshot showing how to read the information on the data refresh page.

  9. 在数据刷新完成后,选择“Azure AI 搜索报表”以查看报表。

    Screenshot showing how to select the Azure AI Search Report on the data refresh page.

  10. 确保在打开报表后刷新页面,使其在打开时显示你的数据。

    Screenshot of the Azure AI Search Power BI report.

修改应用参数

如果要可视化其他存储帐户中的数据或更改要查询的数据天数,请按照以下步骤更改“天数”和“StorageAccount”参数。

  1. 导航到你的 Power BI 应用,找到你的 Azure AI 搜索应用,然后选择“编辑应用”按钮以查看工作区。

    Screenshot showing how to select the Edit app button for the Azure AI Search app.

  2. 从“数据集”选项中选择“设置”

    Screenshot showing how to select Settings from the Azure AI Search Dataset options.

  3. 在“数据集”选项卡中,更改参数值并选择“应用”。 如果连接出现问题,请在同一页面上更新数据源凭据。

  4. 导航回工作区,并从“数据集”选项中选择“立即刷新”。

    Screenshot showing how to select Refresh now from the Azure AI Search Dataset options.

  5. 打开报表以查看更新后的数据。 你可能还需要刷新报表以查看最新数据。

故障排除报告问题

如果你发现找不到你的数据,请执行以下故障排除步骤:

  1. 打开报表并刷新页面以确保查看最新数据。 报表中有一个用于刷新数据的选项。 请选择此选项以获取最新数据。

  2. 确保你提供的存储帐户名称和访问密钥是正确的。 存储帐户名称应当对应于配置了搜索服务日志的帐户。

  3. 确认你的存储帐户包含容器“insights-logs-operationlogs”和“insights-metrics-pt1m”,并且每个容器都有数据。 日志和指标将位于多层文件夹中。

  4. 查看数据集是否仍在刷新。 上面的步骤 8 中显示了刷新状态指示器。 如果仍在刷新,请等待刷新完成,然后再打开并刷新报表。

后续步骤