Skip to content

Invoke agent server span#3473

Open
singankit wants to merge 18 commits intoopen-telemetry:mainfrom
singankit:users/singankit/invoke_agent_server_span
Open

Invoke agent server span#3473
singankit wants to merge 18 commits intoopen-telemetry:mainfrom
singankit:users/singankit/invoke_agent_server_span

Conversation

@singankit
Copy link
Copy Markdown
Contributor

@singankit singankit commented Feb 24, 2026

Fixes #3334

Changes

Add invoke agent span for server as counterpart to existing client invoke agent span. This helps capture server perspective of agent invocation.

Important

Pull requests acceptance are subject to the triage process as described in Issue and PR Triage Management.
PRs that do not follow the guidance above, may be automatically rejected and closed.

Merge requirement checklist

  • CONTRIBUTING.md guidelines followed.
  • Change log entry added, according to the guidelines in When to add a changelog entry.
    • If your PR does not need a change log, start the PR title with [chore]
  • Links to the prototypes or existing instrumentations (when adding or changing conventions)

Add support for OpenAI Responses API operation type in the gen_ai.operation.name attribute.
…t enum

- Rename gen_ai.api.type to openai.api.type (OpenAI-specific attribute)
- Remove 'version' from brief description
- Change from free-form string to strict enum (chat_completions, responses)
- Remove stale 'responses' operation value from gen_ai.operation.name docs
- Update OpenAI registry docs with new attribute
@singankit singankit force-pushed the users/singankit/invoke_agent_server_span branch from 1f6695c to 0d83b95 Compare February 24, 2026 07:20
@singankit singankit changed the title Users/singankit/invoke agent server span Invoke agent server span Feb 25, 2026
Comment thread model/gen-ai/spans.yaml Outdated
Comment thread model/gen-ai/spans.yaml Outdated
Comment thread model/gen-ai/spans.yaml
Comment thread model/gen-ai/spans.yaml
Comment thread model/gen-ai/spans.yaml Outdated
This span is the server counterpart of the [invoke agent client span](/docs/gen-ai/gen-ai-agent-spans.md#invoke-agent-client-span).
It's reported by the GenAI agent server when it receives and processes
an agent invocation request from a client.
extends: attributes.gen_ai.inference.client
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

we may want to extract a common attribute group for client/server

at the same time, I'm a bit unsure if the existing invoke_agent client span is correct in extending the inference client attributes, and so unsure if we should create .inference.common or .invoke_agent.common

cc @lmolkova

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

unsure if the existing invoke_agent client span is correct in extending the inference client attributes

yep, it's not right and we should fix it - #2632

we may want to extract a common attribute group for client/server

👍

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Splitting invoke_agent from inference in: #3514

I'll follow-up after this PR to split out "common" invoke_agent for client/server.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think we can make progress here right now - we should not extend client invoke_agent here anyway

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@lmolkova Is the suggestion to update this PR after @trask PR #3514 gets merged? Or can we move forward with merging this PR and update once other PR goes in?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think @lmolkova's suggesting to go ahead and extend attributes.gen_ai.common.client here. That way you don't need to inherit the few inferences attributes we are removing from invoke_agent in #3514, and then we can follow-up later (after both PRs land) with adding attributes.gen_ai.invoke_agent.common, at which point it should be a pure yaml refactoring (and shouldn't affect any markdown files).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Resolved in 042fecf and 048bde5

Comment thread model/gen-ai/spans.yaml Outdated
Comment thread model/gen-ai/spans.yaml Outdated
Comment on lines +437 to +442
- ref: client.address
requirement_level:
recommended: If applicable
- ref: client.port
requirement_level:
recommended: When `client.address` is set.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

it this actually helpful on GenAI spans? If users want HTTP/transport details, they should enable corresponding spans. I can see it could become useful, but do we need it right now?

Copy link
Copy Markdown
Member

@lmolkova lmolkova Mar 3, 2026

Choose a reason for hiding this comment

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

perhaps opt-in, in case HTTP is not instrumented.

it's important for security, but it still privacy concern

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Make client.address and client.port as opt-in

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Resolved in this commit 4f71b3a

@lmolkova lmolkova moved this from Untriaged to Awaiting codeowners approval in Semantic Conventions Triage Mar 2, 2026
Comment thread model/gen-ai/spans.yaml
Comment thread model/gen-ai/spans.yaml Outdated

**Span kind** MUST be `SERVER`.

This span is the server counterpart of the [invoke agent client span](/docs/gen-ai/gen-ai-agent-spans.md#invoke-agent-client-span).
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

what does this mean? does it explain anything to server instrumentation authors or consumers of telemetry?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks have update the description and updated it to It represents processing of agent invocation requested by a client.

Comment thread model/gen-ai/spans.yaml Outdated
Comment on lines +411 to +412
It's reported by the GenAI agent server when it receives and processes
an agent invocation request from a client.
Copy link
Copy Markdown
Member

@lmolkova lmolkova Mar 9, 2026

Choose a reason for hiding this comment

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

maybe

Suggested change
It's reported by the GenAI agent server when it receives and processes
an agent invocation request from a client.
It represents processing of agent invocation requested by a client.

?

I think 'receives' is covered by protocol spans and depends on how the request is received. This one represents something that happens after receive - processing

Comment thread model/gen-ai/spans.yaml Outdated
This span is the server counterpart of the [invoke agent client span](/docs/gen-ai/gen-ai-agent-spans.md#invoke-agent-client-span).
It's reported by the GenAI agent server when it receives and processes
an agent invocation request from a client.
extends: attributes.gen_ai.inference.client
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think we can make progress here right now - we should not extend client invoke_agent here anyway

Replace 'server counterpart' reference with a concise description
of what the span represents, consistent with how other server spans
(MCP, HTTP, RPC) describe themselves in the codebase.
Per review feedback, the server span should not inherit inference-specific
attributes. Extend attributes.gen_ai.common.client instead.
Add all attributes from the invoke_agent client span (per PR open-telemetry#3514)
to the server span, including token usage with aggregation notes,
inference request parameters, conversation id, content attributes,
and tool definitions.
@lmolkova lmolkova moved this from Awaiting codeowners approval to Ready to be Merged in Semantic Conventions Triage Mar 17, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 1, 2026

This PR has been labeled as stale due to lack of activity. It will be automatically closed if there is no further activity over the next 7 days.

@wolfgangcodes
Copy link
Copy Markdown

Hello @singankit!

With the merging of Move GenAI semantic conventions to its own dedicated repository, the area:gen-ai semantic conventions have a new home. We've made this split in an to be better able to support the rapid pace of change that we are seeing with Gen AI related semantic conventions.

Our ask is that you move this PR to the new repo here: https://github.com/open-telemetry/semantic-conventions-genai

The contribution guide for the new repo can be found here: https://github.com/open-telemetry/semantic-conventions-genai/blob/main/CONTRIBUTING.md. A major difference is making sure there's a representative scenario and reference outlined in:

4. Update reference scenarioss
Changes under model/ or docs/ typically require updating the reference scenarios under reference/ to demonstrate that the proposed updates are capturable.

You may also find that you need to additional updates to you proposal as the new repo use the V2 Schema.

If you would like to discuss or have questions you can reply here, post in slack here, or add an agenda item for the Gen AI SIG.

Thank you so much!

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

Labels

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

[gen-ai] Clarify invoke_agent span creation responsibility in distributed scenarios

4 participants