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/attributes-registry/gen-ai.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,6 +17,7 @@ This document defines the attributes used to describe telemetry in the context o
17
17
| <aid="gen-ai-agent-description"href="#gen-ai-agent-description">`gen_ai.agent.description`</a> | string | Free-form description of the GenAI agent provided by the application. |`Helps with math problems`; `Generates fiction stories`||
18
18
| <aid="gen-ai-agent-id"href="#gen-ai-agent-id">`gen_ai.agent.id`</a> | string | The unique identifier of the GenAI agent. |`asst_5j66UpCpwteGg4YSxUnt7lPY`||
19
19
| <aid="gen-ai-agent-name"href="#gen-ai-agent-name">`gen_ai.agent.name`</a> | string | Human-readable name of the GenAI agent provided by the application. |`Math Tutor`; `Fiction Writer`||
20
+
| <aid="gen-ai-conversation-id"href="#gen-ai-conversation-id">`gen_ai.conversation.id`</a> | string | The unique identifier for a conversation (session, thread), used to store and correlate messages within this conversation. |`conv_5j66UpCpwteGg4YSxUnt7lPY`||
20
21
| <aid="gen-ai-data-source-id"href="#gen-ai-data-source-id">`gen_ai.data_source.id`</a> | string | The data source identifier. [1]|`H7STPQYOND`||
21
22
| <aid="gen-ai-operation-name"href="#gen-ai-operation-name">`gen_ai.operation.name`</a> | string | The name of the operation being performed. [2]|`chat`; `generate_content`; `text_completion`||
22
23
| <aid="gen-ai-output-type"href="#gen-ai-output-type">`gen_ai.output.type`</a> | string | Represents the content type requested by the client. [3]|`text`; `json`; `image`||
Copy file name to clipboardExpand all lines: docs/gen-ai/aws-bedrock.md
+32-17Lines changed: 32 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,11 +37,12 @@ Describes an AWS Bedrock operation span.
37
37
|[`gen_ai.operation.name`](/docs/attributes-registry/gen-ai.md)| string | The name of the operation being performed. [1]|`chat`; `generate_content`; `text_completion`|`Required`||
38
38
|[`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`||
39
39
|[`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 ||
40
-
|[`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]||
40
+
|[`gen_ai.conversation.id`](/docs/attributes-registry/gen-ai.md)| string | The unique identifier for a conversation (session, thread), used to store and correlate messages within this conversation. [4]|`conv_5j66UpCpwteGg4YSxUnt7lPY`|`Conditionally Required` when available ||
41
+
|[`gen_ai.output.type`](/docs/attributes-registry/gen-ai.md)| string | Represents the content type requested by the client. [5]|`text`; `json`; `image`|`Conditionally Required`[6]||
41
42
|[`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 ||
42
-
|[`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 available. ||
43
+
|[`gen_ai.request.model`](/docs/attributes-registry/gen-ai.md)| string | The name of the GenAI model a request is being made to. [7]|`gpt-4`|`Conditionally Required` If available. ||
43
44
|[`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 ||
44
-
|[`server.port`](/docs/attributes-registry/server.md)| int | GenAI server port. [7]|`80`; `8080`; `443`|`Conditionally Required` If `server.address` is set. ||
45
+
|[`server.port`](/docs/attributes-registry/server.md)| int | GenAI server port. [8]|`80`; `8080`; `443`|`Conditionally Required` If `server.address` is set. ||
45
46
|[`aws.bedrock.knowledge_base.id`](/docs/attributes-registry/aws.md)| string | The unique identifier of the AWS Bedrock Knowledge base. A [knowledge base](https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base.html) is a bank of information that can be queried by models to generate more relevant responses and augment prompts. |`XFWUPB9PAW`|`Recommended`||
46
47
|[`gen_ai.request.frequency_penalty`](/docs/attributes-registry/gen-ai.md)| double | The frequency penalty setting for the GenAI request. |`0.1`|`Recommended`||
47
48
|[`gen_ai.request.max_tokens`](/docs/attributes-registry/gen-ai.md)| int | The maximum number of tokens the model generates for a request. |`100`|`Recommended`||
@@ -52,10 +53,10 @@ Describes an AWS Bedrock operation span.
52
53
|[`gen_ai.request.top_p`](/docs/attributes-registry/gen-ai.md)| double | The top_p sampling setting for the GenAI request. |`1.0`|`Recommended`||
53
54
|[`gen_ai.response.finish_reasons`](/docs/attributes-registry/gen-ai.md)| string[]| Array of reasons the model stopped generating tokens, corresponding to each generation received. |`["stop"]`; `["stop", "length"]`|`Recommended`||
54
55
|[`gen_ai.response.id`](/docs/attributes-registry/gen-ai.md)| string | The unique identifier for the completion. |`chatcmpl-123`|`Recommended`||
55
-
|[`gen_ai.response.model`](/docs/attributes-registry/gen-ai.md)| string | The name of the model that generated the response. [8]|`gpt-4-0613`|`Recommended`||
56
+
|[`gen_ai.response.model`](/docs/attributes-registry/gen-ai.md)| string | The name of the model that generated the response. [9]|`gpt-4-0613`|`Recommended`||
56
57
|[`gen_ai.usage.input_tokens`](/docs/attributes-registry/gen-ai.md)| int | The number of tokens used in the GenAI input (prompt). |`100`|`Recommended`||
57
58
|[`gen_ai.usage.output_tokens`](/docs/attributes-registry/gen-ai.md)| int | The number of tokens used in the GenAI response (completion). |`180`|`Recommended`||
58
-
|[`server.address`](/docs/attributes-registry/server.md)| string | GenAI server address. [9]|`example.com`; `10.1.2.80`; `/tmp/my.sock`|`Recommended`||
59
+
|[`server.address`](/docs/attributes-registry/server.md)| string | GenAI server address. [10]|`example.com`; `10.1.2.80`; `/tmp/my.sock`|`Recommended`||
59
60
60
61
**[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.
61
62
@@ -75,19 +76,33 @@ If none of these options apply, the `gen_ai.system` SHOULD be set to `_OTHER`.
75
76
the canonical name of exception that occurred, or another low-cardinality error identifier.
76
77
Instrumentations SHOULD document the list of errors they report.
77
78
78
-
**[4]`gen_ai.output.type`:** This attribute SHOULD be used when the client requests output of a specific type. The model may return zero or more outputs of this type.
79
+
**[4]`gen_ai.conversation.id`:** Instrumentations SHOULD populate conversation id when they have it readily available
80
+
for a given operation, for example:
81
+
82
+
- when client framework being instrumented manages conversation history
83
+
(see [LlamaIndex chat store](https://docs.llamaindex.ai/en/stable/module_guides/storing/chat_stores/))
84
+
85
+
- when instrumenting GenAI client libraries that maintain conversation on the backend side
86
+
(see [AWS Bedrock agent sessions](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-session-state.html),
Application developers that manage conversation history MAY add conversation id to GenAI and other
90
+
spans or logs using custom span or log record processors or hooks provided by instrumentation
91
+
libraries.
92
+
93
+
**[5]`gen_ai.output.type`:** This attribute SHOULD be used when the client requests output of a specific type. The model may return zero or more outputs of this type.
79
94
This attribute specifies the output modality and not the actual output format. For example, if an image is requested, the actual output could be a URL pointing to an image file.
80
95
Additional output format details may be recorded in the future in the `gen_ai.output.{type}.*` attributes.
81
96
82
-
**[5]`gen_ai.output.type`:** when applicable and if the request includes an output format.
97
+
**[6]`gen_ai.output.type`:** when applicable and if the request includes an output format.
83
98
84
-
**[6]`gen_ai.request.model`:** The name of the GenAI model a request is being made to. If the model is supplied by a vendor, then the value must be the exact name of the model requested. If the model is a fine-tuned custom model, the value should have a more specific name than the base model that's been fine-tuned.
99
+
**[7]`gen_ai.request.model`:** The name of the GenAI model a request is being made to. If the model is supplied by a vendor, then the value must be the exact name of the model requested. If the model is a fine-tuned custom model, the value should have a more specific name than the base model that's been fine-tuned.
85
100
86
-
**[7]`server.port`:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available.
101
+
**[8]`server.port`:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available.
87
102
88
-
**[8]`gen_ai.response.model`:** If available. The name of the GenAI model that provided the response. If the model is supplied by a vendor, then the value must be the exact name of the model actually used. If the model is a fine-tuned custom model, the value should have a more specific name than the base model that's been fine-tuned.
103
+
**[9]`gen_ai.response.model`:** If available. The name of the GenAI model that provided the response. If the model is supplied by a vendor, then the value must be the exact name of the model actually used. If the model is a fine-tuned custom model, the value should have a more specific name than the base model that's been fine-tuned.
89
104
90
-
**[9]`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.
105
+
**[10]`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.
91
106
92
107
---
93
108
@@ -134,21 +149,21 @@ Additional output format details may be recorded in the future in the `gen_ai.ou
**[10]:** This refers to the 'generativelanguage.googleapis.com' endpoint. Also known as the AI Studio API. May use common attributes prefixed with 'gcp.gen_ai.'.
162
+
**[11]:** This refers to the 'generativelanguage.googleapis.com' endpoint. Also known as the AI Studio API. May use common attributes prefixed with 'gcp.gen_ai.'.
148
163
149
-
**[11]:** May be used when specific backend is unknown. May use common attributes prefixed with 'gcp.gen_ai.'.
164
+
**[12]:** May be used when specific backend is unknown. May use common attributes prefixed with 'gcp.gen_ai.'.
150
165
151
-
**[12]:** This refers to the 'aiplatform.googleapis.com' endpoint. May use common attributes prefixed with 'gcp.gen_ai.'.
166
+
**[13]:** This refers to the 'aiplatform.googleapis.com' endpoint. May use common attributes prefixed with 'gcp.gen_ai.'.
0 commit comments