Skip to content

Commit ef12e19

Browse files
committed
Address comments from @lmolkova
1 parent 91e7093 commit ef12e19

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

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

+6-3
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ Semantic conventions for individual GenAI systems and frameworks MAY specify dif
4949
| [`gen_ai.operation.name`](/docs/attributes-registry/gen-ai.md) | string | The name of the operation being performed. [1] | `chat`; `text_completion`; `embeddings` | `Required` | ![Development](https://img.shields.io/badge/-development-blue) |
5050
| [`gen_ai.system`](/docs/attributes-registry/gen-ai.md) | string | The Generative AI product as identified by the client or server instrumentation. [2] | `openai` | `Required` | ![Development](https://img.shields.io/badge/-development-blue) |
5151
| [`gen_ai.agent.description`](/docs/attributes-registry/gen-ai.md) | string | Free-form description of the GenAI agent provided by the application. | `Helps with math problems`; `Generates fiction stories` | `Conditionally Required` If provided by the application. | ![Development](https://img.shields.io/badge/-development-blue) |
52+
| [`gen_ai.agent.id`](/docs/attributes-registry/gen-ai.md) | string | The unique identifier of the GenAI agent. | `asst_5j66UpCpwteGg4YSxUnt7lPY` | `Conditionally Required` if applicable. | ![Development](https://img.shields.io/badge/-development-blue) |
5253
| [`gen_ai.agent.name`](/docs/attributes-registry/gen-ai.md) | string | Human-readable name of the GenAI agent provided by the application. | `Math Tutor`; `Fiction Writer` | `Conditionally Required` If provided by the application. | ![Development](https://img.shields.io/badge/-development-blue) |
54+
| [`gen_ai.request.choice.count`](/docs/attributes-registry/gen-ai.md) | int | The target number of candidate completions to return. | `3` | `Conditionally Required` if available, in the request, and !=1 | ![Development](https://img.shields.io/badge/-development-blue) |
5355
| [`gen_ai.request.model`](/docs/attributes-registry/gen-ai.md) | string | The name of the GenAI model a request is being made to. [3] | `gpt-4` | `Conditionally Required` If provided by the application. | ![Development](https://img.shields.io/badge/-development-blue) |
5456
| [`gen_ai.request.seed`](/docs/attributes-registry/gen-ai.md) | int | Requests with same seed value more likely to return same result. | `100` | `Conditionally Required` if applicable and if the request includes a seed | ![Development](https://img.shields.io/badge/-development-blue) |
5557
| [`server.port`](/docs/attributes-registry/server.md) | int | GenAI server port. [4] | `80`; `8080`; `443` | `Conditionally Required` If `server.address` is set. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
@@ -129,7 +131,8 @@ services.
129131

130132
The `gen_ai.operation.name` SHOULD be `invoke_agent`.
131133

132-
The **span name** SHOULD be `invoke_agent {gen_ai.agent.name}`.
134+
The **span name** SHOULD be `invoke_agent {gen_ai.agent.name}` if `gen_ai.agent.name` is readily available.
135+
When `gen_ai.agent.name` is not available, it SHOULD be `invoke_agent`.
133136
Semantic conventions for individual GenAI systems and frameworks MAY specify different span name format.
134137

135138
<!-- semconv span.gen_ai.invoke_agent.client -->
@@ -144,9 +147,9 @@ Semantic conventions for individual GenAI systems and frameworks MAY specify dif
144147
| [`gen_ai.operation.name`](/docs/attributes-registry/gen-ai.md) | string | The name of the operation being performed. [1] | `chat`; `text_completion`; `embeddings` | `Required` | ![Development](https://img.shields.io/badge/-development-blue) |
145148
| [`gen_ai.system`](/docs/attributes-registry/gen-ai.md) | string | The Generative AI product as identified by the client or server instrumentation. [2] | `openai` | `Required` | ![Development](https://img.shields.io/badge/-development-blue) |
146149
| [`error.type`](/docs/attributes-registry/error.md) | string | Describes a class of error the operation ended with. [3] | `timeout`; `java.net.UnknownHostException`; `server_certificate_invalid`; `500` | `Conditionally Required` if the operation ended in an error | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
147-
| [`gen_ai.agent.description`](/docs/attributes-registry/gen-ai.md) | string | Free-form description of the GenAI agent provided by the application. | `Helps with math problems`; `Generates fiction stories` | `Conditionally Required` If provided by the application. | ![Development](https://img.shields.io/badge/-development-blue) |
150+
| [`gen_ai.agent.description`](/docs/attributes-registry/gen-ai.md) | string | Free-form description of the GenAI agent provided by the application. | `Helps with math problems`; `Generates fiction stories` | `Conditionally Required` when available | ![Development](https://img.shields.io/badge/-development-blue) |
148151
| [`gen_ai.agent.id`](/docs/attributes-registry/gen-ai.md) | string | The unique identifier of the GenAI agent. | `asst_5j66UpCpwteGg4YSxUnt7lPY` | `Conditionally Required` if applicable. | ![Development](https://img.shields.io/badge/-development-blue) |
149-
| [`gen_ai.agent.name`](/docs/attributes-registry/gen-ai.md) | string | Human-readable name of the GenAI agent provided by the application. | `Math Tutor`; `Fiction Writer` | `Conditionally Required` If provided by the application. | ![Development](https://img.shields.io/badge/-development-blue) |
152+
| [`gen_ai.agent.name`](/docs/attributes-registry/gen-ai.md) | string | Human-readable name of the GenAI agent provided by the application. | `Math Tutor`; `Fiction Writer` | `Conditionally Required` when available | ![Development](https://img.shields.io/badge/-development-blue) |
150153
| [`gen_ai.output.type`](/docs/attributes-registry/gen-ai.md) | string | Represents the content type requested by the client. [4] | `text`; `json`; `image` | `Conditionally Required` [5] | ![Development](https://img.shields.io/badge/-development-blue) |
151154
| [`gen_ai.request.choice.count`](/docs/attributes-registry/gen-ai.md) | int | The target number of candidate completions to return. | `3` | `Conditionally Required` if available, in the request, and !=1 | ![Development](https://img.shields.io/badge/-development-blue) |
152155
| [`gen_ai.request.model`](/docs/attributes-registry/gen-ai.md) | string | The name of the GenAI model a request is being made to. [6] | `gpt-4` | `Conditionally Required` If provided by the application. | ![Development](https://img.shields.io/badge/-development-blue) |

model/gen-ai/spans.yaml

+7-3
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,9 @@ groups:
172172
attributes:
173173
- ref: gen_ai.system
174174
requirement_level: required
175+
- ref: gen_ai.agent.id
176+
requirement_level:
177+
conditionally_required: if applicable.
175178
- ref: gen_ai.agent.name
176179
requirement_level:
177180
conditionally_required: If provided by the application.
@@ -188,7 +191,8 @@ groups:
188191
with remote agent services.
189192
note: |
190193
The `gen_ai.operation.name` SHOULD be `invoke_agent`.
191-
The **span name** SHOULD be `invoke_agent {gen_ai.agent.name}`.
194+
The **span name** SHOULD be `invoke_agent {gen_ai.agent.name}` if `gen_ai.agent.name` is readily available.
195+
When `gen_ai.agent.name` is not available, it SHOULD be `invoke_agent`.
192196
Semantic conventions for individual GenAI systems and frameworks MAY specify different span name format.
193197
extends: trace.gen_ai.client.common_attributes
194198
attributes:
@@ -199,10 +203,10 @@ groups:
199203
conditionally_required: if applicable.
200204
- ref: gen_ai.agent.name
201205
requirement_level:
202-
conditionally_required: If provided by the application.
206+
conditionally_required: when available
203207
- ref: gen_ai.agent.description
204208
requirement_level:
205-
conditionally_required: If provided by the application.
209+
conditionally_required: when available
206210

207211
- id: span.gen_ai.execute_tool.internal
208212
type: span

0 commit comments

Comments
 (0)