Copilot Studio的可观测性集成

Microsoft Copilot Studio 代理会自动向 Microsoft Agent 365 监控后端发送遥测数据,无需人工 SDK 安装。 这种自动可观测性可查看Microsoft 365 管理中心、Microsoft Defender和Microsoft Purview中的代理活动、性能和错误。

本文介绍Copilot Studio如何自动处理可观测性,以及如何查看遥测数据的位置。

注释

有关 Agent 365 的一般可观测性概念,以及 Pro-code 代理的手动仪器化,请参阅 代理可观测性。 本文着重于 Copilot Studio 代理的自动可观测性。

自动可观测性

Copilot Studio 代理会自动参与 Agent 365 可观测性框架。

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

此自动化无需开发人员即可实现集中监视、安全分析和合规性报告。

捕获的遥测数据

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

注释

  • 仅针对经过身份验证的会话捕获遥测
  • 多租户代理从遥测中排除
  • 名称超过 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 和名称
  • 工具参数:发送的数据(已编辑敏感数据)
  • 用户标识:谁与代理进行了交互(使用 On-Behalf-Of 流时)
  • 其他标识符:租户和环境 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"
}

所有遥测都遵循隐私边界。 消息和工具输入和输出中的敏感用户数据经过修订,对管理员不可见。 遥测用于内部安全监控和合规性目的。

后续步骤