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
|`gen_ai.usage.input_tokens`| int | optional | The number of tokens used in the AI input (prompt). |`10`|
66
-
|`gen_ai.usage.input_tokens.cached`| int | optional | The number of cached tokens used in the AI input (prompt) |`50`|
66
+
|`gen_ai.usage.input_tokens.cached`| int | optional | The number of cached tokens used in the AI input (prompt) **[2]**|`50`|
67
67
|`gen_ai.usage.output_tokens`| int | optional | The number of tokens used in the AI response. |`100`|
68
-
|`gen_ai.usage.output_tokens.reasoning`| int | optional | The number of tokens used for reasoning. |`30`|
68
+
|`gen_ai.usage.output_tokens.reasoning`| int | optional | The number of tokens used for reasoning. **[3]**|`30`|
69
69
|`gen_ai.usage.total_tokens`| int | optional | The total number of tokens used to process the prompt. (input and output) |`190`|
70
70
71
71
-**[0]:** Span attributes only allow primitive data types (like `int`, `float`, `boolean`, `string`). This means you need to use a stringified version of a list of dictionaries. Do NOT set the object/array `[{"foo": "bar"}]` but rather the string `'[{"foo": "bar"}]'` (must be parsable JSON).
72
72
-**[1]:** Each message item uses the format `{role:"", content:""}`. The `role` must be `"user"`, `"assistant"`, `"tool"`, or `"system"`. For messages of the role `tool`, the `content` can be a string or an arbitrary object with information about the tool call. For other messages the `content` can be either a string or a list of dictionaries in the format `{type: "text", text:"..."}`.
73
+
-**[2]:** Cached tokens are a subset of input tokens; `gen_ai.usage.input_tokens` includes `gen_ai.usage.input_tokens.cached`.
74
+
-**[3]:** Reasoning tokens are a subset of output tokens; `gen_ai.usage.output_tokens` includes `gen_ai.usage.output_tokens.reasoning`.
73
75
74
76
## AI Client Span
75
77
@@ -106,13 +108,15 @@ Additional attributes on the span:
106
108
| Attribute | Type | Requirement Level | Description | Example |
|`gen_ai.usage.input_tokens`| int | optional | The number of tokens used in the AI input (prompt). |`10`|
109
-
|`gen_ai.usage.input_tokens.cached`| int | optional | The number of cached tokens used in the AI input (prompt) |`50`|
111
+
|`gen_ai.usage.input_tokens.cached`| int | optional | The number of cached tokens used in the AI input (prompt) **[2]**|`50`|
110
112
|`gen_ai.usage.output_tokens`| int | optional | The number of tokens used in the AI response. |`100`|
111
-
|`gen_ai.usage.output_tokens.reasoning`| int | optional | The number of tokens used for reasoning. |`30`|
113
+
|`gen_ai.usage.output_tokens.reasoning`| int | optional | The number of tokens used for reasoning. **[3]**|`30`|
112
114
|`gen_ai.usage.total_tokens`| int | optional | The total number of tokens used to process the prompt. (input and output) |`190`|
113
115
114
116
-**[0]:** Span attributes only allow primitive data types (like `int`, `float`, `boolean`, `string`). This means you need to use a stringified version of a list of dictionaries. Do NOT set the object/array `[{"foo": "bar"}]` but rather the string `'[{"foo": "bar"}]'` (must be parsable JSON).
115
117
-**[1]:** Each message item uses the format `{role:"", content:""}`. The `role` must be `"user"`, `"assistant"`, `"tool"`, or `"system"`. For messages of the role `tool`, the `content` can be a string or an arbitrary object with information about the tool call. For other messages the `content` can be either a string or a list of dictionaries in the format `{type: "text", text:"..."}`.
118
+
-**[2]:** Cached tokens are a subset of input tokens; `gen_ai.usage.input_tokens` includes `gen_ai.usage.input_tokens.cached`.
119
+
-**[3]:** Reasoning tokens are a subset of output tokens; `gen_ai.usage.output_tokens` includes `gen_ai.usage.output_tokens.reasoning`.
0 commit comments