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
Copy file name to clipboardExpand all lines: docs/gen-ai/anthropic.md
+10-13Lines changed: 10 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -86,12 +86,11 @@ Semantic Conventions for [Anthropic](https://www.anthropic.com/) client spans ex
86
86
|[`gen_ai.usage.cache_read.input_tokens`](/docs/registry/attributes/gen-ai.md)||`Recommended`| int | The number of input tokens served from a provider-managed cache. [10]|`50`|
87
87
|[`gen_ai.usage.input_tokens`](/docs/registry/attributes/gen-ai.md)||`Recommended`| int | The number of tokens used in the GenAI input (prompt). [11]|`100`|
88
88
|[`gen_ai.usage.output_tokens`](/docs/registry/attributes/gen-ai.md)||`Recommended`| int | The number of tokens used in the GenAI response (completion). |`180`|
89
-
|[`gen_ai.usage.reasoning.output_tokens`](/docs/registry/attributes/gen-ai.md)||`Recommended`| int | The number of output tokens used for reasoning (e.g. chain-of-thought, extended thinking). [12]|`50`|
90
-
|[`server.address`](/docs/registry/attributes/server.md)||`Recommended`| string | GenAI server address. [13]|`example.com`; `10.1.2.80`; `/tmp/my.sock`|
91
-
| [`gen_ai.input.messages`](/docs/registry/attributes/gen-ai.md) |  | `Opt-In` | any | The chat history provided to the model as an input. [14] | [<br> {<br> "role": "user",<br> "parts": [<br> {<br> "type": "text",<br> "content": "Weather in Paris?"<br> }<br> ]<br> },<br> {<br> "role": "assistant",<br> "parts": [<br> {<br> "type": "tool_call",<br> "id": "call_VSPygqKTWdrhaFErNvMV18Yl",<br> "name": "get_weather",<br> "arguments": {<br> "location": "Paris"<br> }<br> }<br> ]<br> },<br> {<br> "role": "tool",<br> "parts": [<br> {<br> "type": "tool_call_response",<br> "id": " call_VSPygqKTWdrhaFErNvMV18Yl",<br> "result": "rainy, 57°F"<br> }<br> ]<br> }<br>] |
92
-
|[`gen_ai.output.messages`](/docs/registry/attributes/gen-ai.md)||`Opt-In`| any | Messages returned by the model where each message represents a specific model response (choice, candidate). [15]|[<br> {<br> "role": "assistant",<br> "parts": [<br> {<br> "type": "text",<br> "content": "The weather in Paris is currently rainy with a temperature of 57°F."<br> }<br> ],<br> "finish_reason": "stop"<br> }<br>]|
93
-
|[`gen_ai.system_instructions`](/docs/registry/attributes/gen-ai.md)||`Opt-In`| any | The system message or instructions provided to the GenAI model separately from the chat history. [16]|[<br> {<br> "type": "text",<br> "content": "You are an Agent that greet users, always use greetings tool to respond"<br> }<br>]; [<br> {<br> "type": "text",<br> "content": "You are a language translator."<br> },<br> {<br> "type": "text",<br> "content": "Your mission is to translate text in English to French."<br> }<br>]|
94
-
| [`gen_ai.tool.definitions`](/docs/registry/attributes/gen-ai.md) |  | `Opt-In` | any | The list of source system tool definitions available to the GenAI agent or model. [17] | [<br> {<br> "type": "function",<br> "name": "get_current_weather",<br> "description": "Get the current weather in a given location",<br> "parameters": {<br> "type": "object",<br> "properties": {<br> "location": {<br> "type": "string",<br> "description": "The city and state, e.g. San Francisco, CA"<br> },<br> "unit": {<br> "type": "string",<br> "enum": [<br> "celsius",<br> "fahrenheit"<br> ]<br> }<br> },<br> "required": [<br> "location",<br> "unit"<br> ]<br> }<br> }<br>] |
89
+
|[`server.address`](/docs/registry/attributes/server.md)||`Recommended`| string | GenAI server address. [12]|`example.com`; `10.1.2.80`; `/tmp/my.sock`|
90
+
| [`gen_ai.input.messages`](/docs/registry/attributes/gen-ai.md) |  | `Opt-In` | any | The chat history provided to the model as an input. [13] | [<br> {<br> "role": "user",<br> "parts": [<br> {<br> "type": "text",<br> "content": "Weather in Paris?"<br> }<br> ]<br> },<br> {<br> "role": "assistant",<br> "parts": [<br> {<br> "type": "tool_call",<br> "id": "call_VSPygqKTWdrhaFErNvMV18Yl",<br> "name": "get_weather",<br> "arguments": {<br> "location": "Paris"<br> }<br> }<br> ]<br> },<br> {<br> "role": "tool",<br> "parts": [<br> {<br> "type": "tool_call_response",<br> "id": " call_VSPygqKTWdrhaFErNvMV18Yl",<br> "result": "rainy, 57°F"<br> }<br> ]<br> }<br>] |
91
+
|[`gen_ai.output.messages`](/docs/registry/attributes/gen-ai.md)||`Opt-In`| any | Messages returned by the model where each message represents a specific model response (choice, candidate). [14]|[<br> {<br> "role": "assistant",<br> "parts": [<br> {<br> "type": "text",<br> "content": "The weather in Paris is currently rainy with a temperature of 57°F."<br> }<br> ],<br> "finish_reason": "stop"<br> }<br>]|
92
+
|[`gen_ai.system_instructions`](/docs/registry/attributes/gen-ai.md)||`Opt-In`| any | The system message or instructions provided to the GenAI model separately from the chat history. [15]|[<br> {<br> "type": "text",<br> "content": "You are an Agent that greet users, always use greetings tool to respond"<br> }<br>]; [<br> {<br> "type": "text",<br> "content": "You are a language translator."<br> },<br> {<br> "type": "text",<br> "content": "Your mission is to translate text in English to French."<br> }<br>]|
93
+
| [`gen_ai.tool.definitions`](/docs/registry/attributes/gen-ai.md) |  | `Opt-In` | any | The list of source system tool definitions available to the GenAI agent or model. [16] | [<br> {<br> "type": "function",<br> "name": "get_current_weather",<br> "description": "Get the current weather in a given location",<br> "parameters": {<br> "type": "object",<br> "properties": {<br> "location": {<br> "type": "string",<br> "description": "The city and state, e.g. San Francisco, CA"<br> },<br> "unit": {<br> "type": "string",<br> "enum": [<br> "celsius",<br> "fahrenheit"<br> ]<br> }<br> },<br> "required": [<br> "location",<br> "unit"<br> ]<br> }<br> }<br>] |
95
94
96
95
**[1]`gen_ai.operation.name`:** If one of the predefined values applies, but specific system uses a different name it's RECOMMENDED to document it in the semantic conventions for specific GenAI system and use system-specific name in the instrumentation. If a different name is not documented, instrumentation libraries SHOULD use applicable predefined value.
97
96
@@ -130,11 +129,9 @@ Additional output format details may be recorded in the future in the `gen_ai.ou
**[12]`gen_ai.usage.reasoning.output_tokens`:**The value SHOULD be included in `gen_ai.usage.output_tokens`.
132
+
**[12]`server.address`:**When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available.
134
133
135
-
**[13]`server.address`:** When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available.
136
-
137
-
**[14]`gen_ai.input.messages`:** Instrumentations MUST follow [Input messages JSON schema](/docs/gen-ai/gen-ai-input-messages.json).
134
+
**[13]`gen_ai.input.messages`:** Instrumentations MUST follow [Input messages JSON schema](/docs/gen-ai/gen-ai-input-messages.json).
138
135
When the attribute is recorded on events, it MUST be recorded in structured
139
136
form. When recorded on spans, it MAY be recorded as a JSON string if structured
140
137
format is not supported and SHOULD be recorded in structured form otherwise.
@@ -149,7 +146,7 @@ input messages.
149
146
See [Recording content on attributes](/docs/gen-ai/gen-ai-spans.md#recording-content-on-attributes)
150
147
section for more details.
151
148
152
-
**[15]`gen_ai.output.messages`:** Instrumentations MUST follow [Output messages JSON schema](/docs/gen-ai/gen-ai-output-messages.json)
149
+
**[14]`gen_ai.output.messages`:** Instrumentations MUST follow [Output messages JSON schema](/docs/gen-ai/gen-ai-output-messages.json)
153
150
154
151
Each message represents a single output choice/candidate generated by
155
152
the model. Each message corresponds to exactly one generation
@@ -169,7 +166,7 @@ output messages.
169
166
See [Recording content on attributes](/docs/gen-ai/gen-ai-spans.md#recording-content-on-attributes)
170
167
section for more details.
171
168
172
-
**[16]`gen_ai.system_instructions`:** This attribute SHOULD be used when the corresponding provider or API
169
+
**[15]`gen_ai.system_instructions`:** This attribute SHOULD be used when the corresponding provider or API
173
170
allows to provide system instructions or messages separately from the
174
171
chat history.
175
172
@@ -190,7 +187,7 @@ system instructions.
190
187
See [Recording content on attributes](/docs/gen-ai/gen-ai-spans.md#recording-content-on-attributes)
191
188
section for more details.
192
189
193
-
**[17]`gen_ai.tool.definitions`:** The value of this attribute matches source system tool definition format.
190
+
**[16]`gen_ai.tool.definitions`:** The value of this attribute matches source system tool definition format.
194
191
195
192
It's expected to be an array of objects where each object represents a tool definition. In case a serialized string is available
196
193
to the instrumentation, the instrumentation SHOULD do the best effort to
0 commit comments