You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 57523dd
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: develop-docs/sdk/telemetry/traces/modules/ai-agents.mdx
+36-1Lines changed: 36 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,7 +52,7 @@ This span represents a request to an AI model or service that generates a respon
52
52
53
53
- Span `op`**SHOULD** be `"gen_ai.{gen_ai.operation.name}"`. (e.g. `"gen_ai.chat"`)
54
54
- Span `name`**SHOULD** be `"{gen_ai.operation.name} {gen_ai.request.model}"`. (e.g. `"chat o3-mini"`)
55
-
- Attribute `gen_ai.operation.name`**MUST** be `"chat"`, `"embeddings"`, `"generate_content"` or `"text_completion"`.
55
+
- Attribute `gen_ai.operation.name`**MUST** be `"chat"`, `"generate_content"` or `"text_completion"`.
56
56
- Attribute `gen_ai.provider.name`**MUST** be the Generative AI product as identified by the client or server instrumentation. (e.g. `"openai"`)
57
57
- Attribute `gen_ai.request.model`**MUST** be the requested model. (e.g. `"gpt-4o"`)
58
58
- Attribute `gen_ai.response.model`**MUST** be the concrete response model. (e.g. `"gpt-4o-2024-08-06"`)
@@ -111,6 +111,41 @@ Additional attributes on the span:
111
111
-**[2]:** Cached tokens are a subset of input tokens; `gen_ai.usage.input_tokens` includes `gen_ai.usage.cache_read.input_tokens`.
112
112
-**[3]:** Reasoning tokens are a subset of output tokens; `gen_ai.usage.output_tokens` includes `gen_ai.usage.reasoning.output_tokens`.
113
113
114
+
## Embedding Span
115
+
116
+
This span represents a request to a provider to encode input into numeric vector embeddings.
117
+
118
+
- Span `op`**SHOULD** be `"gen_ai.embeddings"`.
119
+
- Span `name`**SHOULD** be `"embeddings {gen_ai.request.model}"`. (e.g. `"embeddings text-embedding-3-small"`)
120
+
- Attribute `gen_ai.operation.name`**MUST** be `"embeddings"`.
121
+
- Attribute `gen_ai.provider.name`**MUST** be the Generative AI product as identified by the client or server instrumentation. (e.g. `"openai"`)
122
+
- Attribute `gen_ai.request.model`**MUST** be the requested model. (e.g. `"text-embedding-3-small"`)
123
+
- Attribute `gen_ai.response.model`**MUST** be the concrete response model. (e.g. `"text-embedding-3-small-001"`)
124
+
- If the request originates from an agent, the `gen_ai.agent.name` attribute **SHOULD** be set to the name of the agent. (e.g. `"Weather Agent"`)
125
+
- If relevant, the `gen_ai.pipeline.name` attribute **SHOULD** be set to the name of the AI workflow, pipeline or chain within which the agent operates. (e.g. `"weather-pipeline"`)
0 commit comments