Copilot Studio 的可观测性集成

Microsoft Copilot Studio 智能体会自动向 Microsoft Agent 365 可观测性后端发送遥测数据——无需手动进行 SDK instrumentation。 这种自动可观测性可在 Microsoft 365 管理中心、Microsoft Defender 和 Microsoft Purview 中提供智能体活动、性能和错误的可见性。

本文说明了 Copilot Studio 如何自动处理可观测性,以及在哪里查看遥测数据。

备注

有关 Agent 365 的一般可观测性概念,以及专业代码智能体的手动检测,请参阅智能体可观测性。 本文重点介绍 Copilot Studio 智能体的自动可观测性。

自动可观测性

Copilot Studio 智能体会自动参与 Agent 365 可观测性框架:

  • 无需 SDK:与需要安装和配置 OpenTelemetry SDK 的专业代码智能体不同,Copilot Studio 在平台运行时中处理所有遥测数据发送。
  • 符合 OpenTelemetry 规范:遥测数据遵循 OpenTelemetry 语义约定,确保与专业代码智能体及其他平台保持一致。
  • 自动采集:遥测数据无需额外配置即可流向 Agent 365 可观测性后端。
  • 即时可用:观测性数据会在智能体活动发生的几分钟内显示在 Microsoft 365 管理中心。

这种自动化功能无需开发人员介入,即可实现集中式监控、安全分析和合规性报告。

捕获哪些遥测数据

Copilot Studio 会自动发出两个用于生成式 AI 跨度的 OpenTelemetry 语义约定:

备注

  • 仅针对 经过身份验证的会话 捕获遥测数据
  • 多租户智能体被从遥测中排除
  • 名称超过 42 个字符的智能体不会被记录
  • 大型输入和输出在以下字段中自动截断:
    • 输出消息
    • 工具参数
    • 工具响应 (gen_ai.event.content)
    • 智能体描述

调用智能体

捕获智能体调用活动:

  • 智能体标识:被调用的智能体的 ID、名称、Entra ID 和类型
  • 用户识别:谁与智能体交互(使用代理流时)
  • 输入消息:用户发送给智能体的消息(敏感数据已屏蔽)
  • 其他标识符:租户和环境 ID
  • 开始和结束时间戳:调用开始和结束的时间

示例事件

{
  "Name": "InvokeAgent",
  "Attributes": {
    "gen_ai.operation.name": "invoke_agent",
    "gen_ai.agent.id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "gen_ai.agent.name": "customer-support-agent",
    "gen_ai.agent.applicationid": "12345678-90ab-cdef-1234-567890abcdef",
    "gen_ai.agent.platformid": "Default-11111111-2222-3333-4444-555555555555_01234567-89ab-cdef-0123-456789abcdef",
    "gen_ai.agent.type": "CopilotStudio",
    "tenant.id": "11111111-2222-3333-4444-555555555555",
    "gen_ai.channel.name": "Copilot Studio Test Pane",
    "gen_ai.execution.type": "HumanToAgent",
    "gen_ai.conversation.id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
    "gen_ai.caller.id": "99999999-8888-7777-6666-555555555555",
    "gen_ai.caller.upn": "alex.smith@contoso.com",
    "gen_ai.caller.name": "Alex Smith",
    "gen_ai.caller.client.ip": "192.168.1.100",
    "gen_ai.caller.tenantid": "11111111-2222-3333-4444-555555555555",
    "gen_ai.input.messages": "What's the weather in Seattle?",
    "env.id": "Default-11111111-2222-3333-4444-555555555555"
  },
  "StartTimeUnixNano": 1700000000000000000,
  "EndTimeUnixNano": 0,
  "SpanId": "aaaa1111-bbbb-2222-cccc-333333333333"
}

输出消息

捕获智能体的输出:

  • 输出消息:智能体对用户的响应(敏感数据已屏蔽)

备注

来自智能体调用或工具执行的错误消息将作为输出消息记录。

以下是另一个示例事件。

{
  "Name": "OutputMessages",
  "Attributes": {
    "gen_ai.operation.name": "output_messages",
    "gen_ai.agent.id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "gen_ai.agent.name": "customer-support-agent",
    "gen_ai.agent.applicationid": "12345678-90ab-cdef-1234-567890abcdef",
    "gen_ai.agent.platformid": "Default-11111111-2222-3333-4444-555555555555_01234567-89ab-cdef-0123-456789abcdef",
    "gen_ai.agent.type": "CopilotStudio",
    "tenant.id": "11111111-2222-3333-4444-555555555555",
    "gen_ai.output.messages": "The current weather in **Seattle, WA** is:\n\n- **Temperature:** 18°C (feels like 17°C)...",
    "gen_ai.conversation.id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
    "gen_ai.channel.name": "Copilot Studio Test Pane",
    "gen_ai.caller.id": "99999999-8888-7777-6666-555555555555",
    "gen_ai.caller.upn": "alex.smith@contoso.com",
    "gen_ai.caller.name": "Alex Smith",
    "gen_ai.caller.client.ip": "192.168.1.100",
    "gen_ai.caller.tenantid": "11111111-2222-3333-4444-555555555555",
    "env.id": "Default-11111111-2222-3333-4444-555555555555"
  },
  "StartTimeUnixNano": 0,
  "EndTimeUnixNano": 1700000005000000000,
  "SpanId": "bbbb2222-cccc-3333-dddd-444444444444",
  "ParentSpanId": "aaaa1111-bbbb-2222-cccc-333333333333"
}

执行工具

记录智能体使用连接器或操作时工具的执行情况:

  • 智能体标识:被调用的智能体的 ID、名称、Entra ID 和类型
  • 工具标识:已执行工具的 ID 和名称
  • 工具参数:发送了哪些数据(编辑的敏感数据)
  • 用户标识:与智能体进行交互的用户(在使用“代为执行”流时)
  • 其他标识符:租户和环境 ID
  • 开始和结束时间戳:执行开始和结束的时间

以下是另一个示例事件。

{
  "Name": "ExecuteTool",
  "Attributes": {
    "gen_ai.operation.name": "execute_tool",
    "gen_ai.agent.id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "gen_ai.agent.name": "customer-support-agent",
    "gen_ai.agent.applicationid": "12345678-90ab-cdef-1234-567890abcdef",
    "gen_ai.agent.platformid": "Default-11111111-2222-3333-4444-555555555555_01234567-89ab-cdef-0123-456789abcdef",
    "gen_ai.agent.type": "CopilotStudio",
    "tenant.id": "11111111-2222-3333-4444-555555555555",
    "gen_ai.tool.name": "msnweather:CurrentWeather",
    "gen_ai.tool.arguments": "{\"Location\":\"Seattle, WA\",\"units\":\"C\"}",
    "gen_ai.tool.call.id": "/providers/Microsoft.PowerApps/apis/shared_msnweather:CurrentWeather:abcdef12-3456-7890-abcd-ef1234567890",
    "gen_ai.tool.type": "Power Platform Connector",
    "gen_ai.conversation.id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
    "gen_ai.event.content": "{ /* tool execution results */ }",
    "gen_ai.channel.name": "Copilot Studio Test Pane",
    "gen_ai.caller.id": "99999999-8888-7777-6666-555555555555",
    "gen_ai.caller.upn": "alex.smith@contoso.com",
    "gen_ai.caller.name": "Alex Smith",
    "gen_ai.caller.client.ip": "192.168.1.100",
    "gen_ai.caller.tenantid": "11111111-2222-3333-4444-555555555555",
    "env.id": "Default-11111111-2222-3333-4444-555555555555"
  },
  "StartTimeUnixNano": 1700000002000000000,
  "EndTimeUnixNano": 0,
  "SpanId": "cccc3333-dddd-4444-eeee-555555555555",
  "ParentSpanId": "aaaa1111-bbbb-2222-cccc-333333333333"
}

所有遥测数据均遵守隐私边界。 消息以及工具输入和输出中的敏感用户数据均经过屏蔽,管理员无法查看。 遥测数据用于内部安全监控和合规性目的。

后续步骤