Skip to content

OTEL chat spans do not have the proper parent span for subagents #4858

Description

@Etienne-M

Describe the bug

When OTEL is enabled and copilot uses the task tool to start a subagent, an invoke_agent span is created which contains all the execute_tool spans, but a single chat span at the very beginning. All other chat spans do not have the appropriate parent set to the invoke_agent span.

This is especially confusing when copilot starts multiple subagents, because then the chat spans are all mixed together, and the github.copilot.turn_id do not make sense.

Affected version

No response

Steps to reproduce the behavior

  1. Enable OTEL
  2. Ask copilot to use the task tool multiple times, e.g. "Using the task tool, ask three sub-agents to summarize the last five commits of this project, then compare their summaries."
  3. Inspect the OTEL trace

Expected behavior

No response

Additional context

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions