-
Notifications
You must be signed in to change notification settings - Fork 273
[gen-ai] expand invoke_agent span documentation beyond remote agents #2881
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Use this changelog template to create an entry for release notes. | ||
# | ||
# If your change doesn't affect end users you should instead start | ||
# your pull request title with [chore] or use the "Skip Changelog" label. | ||
|
||
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' | ||
change_type: enhancement | ||
|
||
# The name of the area of concern in the attributes-registry, (e.g. http, cloud, db) | ||
component: gen-ai | ||
|
||
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). | ||
note: "`invoke_agent` spans now include span kind guidance (CLIENT/INTERNAL/SERVER) and clarify when `server.*` attributes should be set." | ||
|
||
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. | ||
# The values here must be integers. | ||
issues: [2837] | ||
|
||
# (Optional) One or more lines of additional information to render under the primary note. | ||
# These lines will be padded with 2 spaces and then inserted directly into the document. | ||
# Use pipe (|) for multiline entries. | ||
subtext: |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -178,14 +178,21 @@ Instrumentations SHOULD document the list of errors they report. | |
|
||
**Status:**  | ||
|
||
Describes GenAI agent invocation and is usually applicable when working with remote agent services. | ||
Describes GenAI agent invocation. | ||
|
||
The `gen_ai.operation.name` SHOULD be `invoke_agent`. | ||
The **span name** SHOULD be `invoke_agent {gen_ai.agent.name}` if `gen_ai.agent.name` is readily available. | ||
When `gen_ai.agent.name` is not available, it SHOULD be `invoke_agent`. | ||
Semantic conventions for individual GenAI systems and frameworks MAY specify different span name format. | ||
|
||
**Span kind** SHOULD be `CLIENT`. | ||
**Span kind** SHOULD be `CLIENT` and MAY be set to `INTERNAL` on spans representing | ||
invocation of agents running in the same process or `SERVER` when instrumenting | ||
the agent service itself. | ||
|
||
It's RECOMMENDED to use `CLIENT` kind when the agent being instrumented usually runs | ||
in a different process than its caller or when the agent invocation happens over | ||
instrumented protocol such as HTTP. | ||
|
||
`server.address` and `server.port` attributes SHOULD be set when span kind is `CLIENT`. | ||
|
||
|
||
**Span status** SHOULD follow the [Recording Errors](/docs/general/recording-errors.md) document. | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -252,13 +252,21 @@ groups: | |
stability: development | ||
span_kind: client | ||
brief: > | ||
Describes GenAI agent invocation and is usually applicable when working | ||
with remote agent services. | ||
Describes GenAI agent invocation. | ||
note: | | ||
The `gen_ai.operation.name` SHOULD be `invoke_agent`. | ||
The **span name** SHOULD be `invoke_agent {gen_ai.agent.name}` if `gen_ai.agent.name` is readily available. | ||
When `gen_ai.agent.name` is not available, it SHOULD be `invoke_agent`. | ||
Semantic conventions for individual GenAI systems and frameworks MAY specify different span name format. | ||
|
||
**Span kind** SHOULD be `CLIENT` and MAY be set to `INTERNAL` on spans representing | ||
invocation of agents running in the same process or `SERVER` when instrumenting | ||
the agent service itself. | ||
It's RECOMMENDED to use `CLIENT` kind when the agent being instrumented usually runs | ||
in a different process than its caller or when the agent invocation happens over | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you please add more clarification when to use different span kind, like what you clarified
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated documentation note section with examples |
||
instrumented protocol such as HTTP. | ||
|
||
`server.address` and `server.port` attributes SHOULD be set when span kind is `CLIENT`. | ||
extends: attributes.gen_ai.inference.client | ||
attributes: | ||
- ref: gen_ai.provider.name | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about following?
s/span kind guidance (CLIENT/INTERNAL/SERVER)/span kind (CLIENT/INTERNAL/SERVER) guidance
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the suggestion! Updated to be "span kind (CLIENT/INTERNAL/SERVER) guidance"