Skip to content

docs(gen-ai): clarify remote client vs local internal agent invocations (#493) - #524

Open
1aifanatic wants to merge 3 commits into
open-telemetry:mainfrom
1aifanatic:docs/explain-remote-client-vs-local-agent-493
Open

1aifanatic wants to merge 3 commits into
open-telemetry:mainfrom
1aifanatic:docs/explain-remote-client-vs-local-agent-493

Conversation

@1aifanatic

@1aifanatic 1aifanatic commented Sep 18, 2026

Copy link
Copy Markdown

Description

Fixes #493.

This PR clarifies the architectural distinction between remote (hosted) agent services and local (in-process) agent executions in the GenAI semantic conventions:

  1. Local vs Remote Execution Models:

    • gen_ai.invoke_agent.client (CLIENT kind): Represents invoking a remote or hosted agent service across a network boundary (e.g., OpenAI Assistants API, AWS Bedrock Agents, Google Cloud Vertex AI Reasoning Engine, Azure AI Foundry Agent Service, or custom enterprise agent microservices).
    • gen_ai.invoke_agent.internal (INTERNAL kind): Represents an agent framework executing the reasoning and orchestration loop locally within the calling process (e.g., LangChain, CrewAI, AutoGen, Google ADK).
  2. Distributed and Multi-Tier Agent Architectures:

    • Explicitly documents trace context propagation and span expectations when a client application calls a remote agent service that executes an agent internally.
    • Clarifies that both CLIENT and INTERNAL spans are expected and valid in distributed traces (addressing questions from [gen-ai] Clarify invoke_agent span creation responsibility in distributed scenarios #308): the client span measures caller-observed network duration and errors, while the internal span captures server-side execution details, reasoning cycles, tool invocations, and child operations.
  3. Updated Model Notes:

    • Updated brief and note in model/gen-ai/spans.yaml for both span types and regenerated docs using Weaver.
    • Added a Towncrier changelog fragment under changelog.d/524.clarification.md.

Verification

  • weaver registry check: passed with zero policy violations.
  • weaver registry update-markdown: successfully updated embedded snippets in documentation.
  • towncrier build --draft: verified changelog rendering.
  • run-scenario openai-agents: passed.

…-telemetry#493)

Clarify the architectural distinction between remote/hosted agent services
(gen_ai.invoke_agent.client with CLIENT kind) and local in-process agent
execution (gen_ai.invoke_agent.internal with INTERNAL kind).

Document span expectations in distributed multi-tier architectures where a
remote client calls an agent service that executes an agent internally.
Copilot AI balanced review requested due to automatic review settings September 18, 2026 02:56
@1aifanatic
1aifanatic requested a review from a team as a code owner September 18, 2026 02:56
@linux-foundation-easycla

linux-foundation-easycla Bot commented Sep 18, 2026

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Sep 18, 2026

Copy link
Copy Markdown

Pull request dashboard status

Waiting on reviewers · refreshed 2026-09-18 03:08 UTC

Review the latest changes.

Status above doesn't look right?
  • Just replied or pushed? Anything around or after the refresh time above may not be picked up yet — give it a few minutes.
  • Anything look wrong? Report it with what you expected; it helps us improve the dashboard.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The guidance excludes non-network process boundaries and lacks a distributed reference scenario.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Clarifies how GenAI agent spans represent remote and in-process execution.

Changes:

  • Distinguishes CLIENT and INTERNAL agent invocations.
  • Documents distributed trace structure and context propagation.
  • Adds a clarification changelog entry.
File summaries
File Description
model/gen-ai/spans.yaml Refines agent span guidance.
docs/gen-ai/gen-ai-agent-spans.md Documents local, remote, and distributed execution.
changelog.d/524.clarification.md Records the clarification.
Review details

Suppressed comments (3)

model/gen-ai/spans.yaml:571

  • This leaves out agent services running in another process over non-network IPC. Those invocations are not eligible for an INTERNAL span, so the fallback should use the same process-boundary test as the span's brief.
      For agent invocations across a network boundary to a remote service,
      instrumentations SHOULD use `gen_ai.invoke_agent.client` instead.

docs/gen-ai/gen-ai-agent-spans.md:44

  • This makes both W3C fields appear mandatory for every transport, but OpenTelemetry propagators are configurable and tracestate is optional even with W3C Trace Context. Also, gRPC exposes carrier entries as metadata rather than headers. Describe propagation through the configured propagator and keep W3C as an example.
2. Trace context (W3C `traceparent` and `tracestate`) is propagated over the transport protocol (e.g. HTTP or gRPC headers).

docs/gen-ai/gen-ai-agent-spans.md:48

  • This establishes a new expectation that client and internal agent spans coexist in one propagated distributed trace, but no reference scenario demonstrates that relationship. Existing scenarios emit either gen_ai.invoke_agent.client or gen_ai.invoke_agent.internal independently, and the cited openai-agents run covers only the local span. Add a library-backed distributed scenario that records both spans and their propagated parentage.
Both the `CLIENT` and `INTERNAL` spans are expected and valid in distributed traces: the client span measures end-to-end caller-perceived duration and transport errors, while the internal span captures server-side execution details, reasoning cycles, and child operations.
  • Files reviewed: 3/3 changed files
  • Comments generated: 2
  • Review effort level: Balanced

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread docs/gen-ai/gen-ai-agent-spans.md Outdated
GenAI agent execution models fall into two primary categories:

- **Remote (hosted) agents (`CLIENT` kind)**:
An application or orchestrator invokes an external, hosted agent service across a network boundary (e.g. over HTTP or gRPC). Examples include cloud-managed agent platforms (OpenAI Assistants API, AWS Bedrock Agents, Google Cloud Vertex AI Reasoning Engine, Azure AI Foundry Agent Service) or custom enterprise agent microservices. These invocations are instrumented using `gen_ai.invoke_agent.client` with span kind `CLIENT`, capturing caller-observed latency, transport errors, and high-level request parameters.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 589c958: generalized the definition to out-of-process boundaries (covering both network transports and local IPC), and clarified context propagation through configured propagators (such as W3C Trace Context over HTTP headers, gRPC metadata, or IPC context).

Comment thread model/gen-ai/spans.yaml Outdated
Comment on lines +518 to +520
A client span describes invoking a remote or hosted agent service across a
network boundary (e.g. OpenAI Assistants API, AWS Bedrock Agents, Google Cloud
Vertex AI Reasoning Engine, Azure AI Foundry Agent Service, or a remote agent microservice).

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 589c958: updated to describe out-of-process agent services across process boundaries (including local IPC) rather than solely network boundaries.

@1aifanatic

Copy link
Copy Markdown
Author

/dashboard route:reviewers

@opentelemetry-pr-dashboard

Copy link
Copy Markdown

@1aifanatic, this pull request was routed to reviewers. The handoff remains active across pushes until newer actionable human feedback arrives. Top-level feedback through this request will not return; unresolved review threads remain open.

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Explain that client agent is remote agent and internal is local

2 participants