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/gen-ai-metrics.md
+10-10
Original file line number
Diff line number
Diff line change
@@ -75,9 +75,9 @@ This metric SHOULD be specified with [ExplicitBucketBoundaries] of [1, 4, 16, 64
75
75
|[`gen_ai.request.model`](/docs/attributes-registry/gen-ai.md)| string | The name of the GenAI model a request is being made to. |`gpt-4`|`Required`||
76
76
|[`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`||
77
77
|[`gen_ai.token.type`](/docs/attributes-registry/gen-ai.md)| string | The type of token being counted. |`input`; `output`|`Required`||
78
-
|[`server.port`](/docs/attributes-registry/server.md)| int |Server port number. [3]|`80`; `8080`; `443`|`Conditionally Required` If `sever.address` is set. ||
78
+
|[`server.port`](/docs/attributes-registry/server.md)| int |GenAI server port. [3]|`80`; `8080`; `443`|`Conditionally Required` If `server.address` is set. ||
79
79
|[`gen_ai.response.model`](/docs/attributes-registry/gen-ai.md)| string | The name of the model that generated the response. |`gpt-4-0613`|`Recommended`||
80
-
|[`server.address`](/docs/attributes-registry/server.md)| string |Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. [4]|`example.com`; `10.1.2.80`; `/tmp/my.sock`|`Recommended`||
80
+
|[`server.address`](/docs/attributes-registry/server.md)| string |GenAI server address. [4]|`example.com`; `10.1.2.80`; `/tmp/my.sock`|`Recommended`||
81
81
82
82
**[1]:** 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.
83
83
@@ -165,9 +165,9 @@ This metric SHOULD be specified with [ExplicitBucketBoundaries] of [ 0.01, 0.02,
165
165
|[`gen_ai.request.model`](/docs/attributes-registry/gen-ai.md)| string | The name of the GenAI model a request is being made to. |`gpt-4`|`Required`||
166
166
|[`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`||
167
167
|[`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 ||
168
-
|[`server.port`](/docs/attributes-registry/server.md)| int |Server port number. [4]|`80`; `8080`; `443`|`Conditionally Required` If `sever.address` is set. ||
168
+
|[`server.port`](/docs/attributes-registry/server.md)| int |GenAI server port. [4]|`80`; `8080`; `443`|`Conditionally Required` If `server.address` is set. ||
169
169
|[`gen_ai.response.model`](/docs/attributes-registry/gen-ai.md)| string | The name of the model that generated the response. |`gpt-4-0613`|`Recommended`||
170
-
|[`server.address`](/docs/attributes-registry/server.md)| string |Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. [5]|`example.com`; `10.1.2.80`; `/tmp/my.sock`|`Recommended`||
170
+
|[`server.address`](/docs/attributes-registry/server.md)| string |GenAI server address. [5]|`example.com`; `10.1.2.80`; `/tmp/my.sock`|`Recommended`||
171
171
172
172
**[1]:** 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.
173
173
@@ -265,9 +265,9 @@ This metric SHOULD be specified with [ExplicitBucketBoundaries] of
265
265
|[`gen_ai.request.model`](/docs/attributes-registry/gen-ai.md)| string | The name of the GenAI model a request is being made to. |`gpt-4`|`Required`||
266
266
|[`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`||
267
267
|[`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 ||
268
-
|[`server.port`](/docs/attributes-registry/server.md)| int |Server port number. [4]|`80`; `8080`; `443`|`Conditionally Required` If `sever.address` is set. ||
268
+
|[`server.port`](/docs/attributes-registry/server.md)| int |GenAI server port. [4]|`80`; `8080`; `443`|`Conditionally Required` If `server.address` is set. ||
269
269
|[`gen_ai.response.model`](/docs/attributes-registry/gen-ai.md)| string | The name of the model that generated the response. |`gpt-4-0613`|`Recommended`||
270
-
|[`server.address`](/docs/attributes-registry/server.md)| string |Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. [5]|`example.com`; `10.1.2.80`; `/tmp/my.sock`|`Recommended`||
270
+
|[`server.address`](/docs/attributes-registry/server.md)| string |GenAI server address. [5]|`example.com`; `10.1.2.80`; `/tmp/my.sock`|`Recommended`||
271
271
272
272
**[1]:** 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.
273
273
@@ -364,9 +364,9 @@ This metric SHOULD be specified with [ExplicitBucketBoundaries] of
364
364
|[`gen_ai.operation.name`](/docs/attributes-registry/gen-ai.md)| string | The name of the operation being performed. [1]|`chat`; `text_completion`|`Required`||
365
365
|[`gen_ai.request.model`](/docs/attributes-registry/gen-ai.md)| string | The name of the GenAI model a request is being made to. |`gpt-4`|`Required`||
366
366
|[`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`||
367
-
|[`server.port`](/docs/attributes-registry/server.md)| int |Server port number. [3]|`80`; `8080`; `443`|`Conditionally Required` If `sever.address` is set. ||
367
+
|[`server.port`](/docs/attributes-registry/server.md)| int |GenAI server port. [3]|`80`; `8080`; `443`|`Conditionally Required` If `server.address` is set. ||
368
368
|[`gen_ai.response.model`](/docs/attributes-registry/gen-ai.md)| string | The name of the model that generated the response. |`gpt-4-0613`|`Recommended`||
369
-
|[`server.address`](/docs/attributes-registry/server.md)| string |Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. [4]|`example.com`; `10.1.2.80`; `/tmp/my.sock`|`Recommended`||
369
+
|[`server.address`](/docs/attributes-registry/server.md)| string |GenAI server address. [4]|`example.com`; `10.1.2.80`; `/tmp/my.sock`|`Recommended`||
370
370
371
371
**[1]:** 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.
372
372
@@ -451,9 +451,9 @@ This metric SHOULD be specified with [ExplicitBucketBoundaries] of
451
451
|[`gen_ai.operation.name`](/docs/attributes-registry/gen-ai.md)| string | The name of the operation being performed. [1]|`chat`; `text_completion`|`Required`||
452
452
|[`gen_ai.request.model`](/docs/attributes-registry/gen-ai.md)| string | The name of the GenAI model a request is being made to. |`gpt-4`|`Required`||
453
453
|[`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`||
454
-
|[`server.port`](/docs/attributes-registry/server.md)| int |Server port number. [3]|`80`; `8080`; `443`|`Conditionally Required` If `sever.address` is set. ||
454
+
|[`server.port`](/docs/attributes-registry/server.md)| int |GenAI server port. [3]|`80`; `8080`; `443`|`Conditionally Required` If `server.address` is set. ||
455
455
|[`gen_ai.response.model`](/docs/attributes-registry/gen-ai.md)| string | The name of the model that generated the response. |`gpt-4-0613`|`Recommended`||
456
-
|[`server.address`](/docs/attributes-registry/server.md)| string |Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. [4]|`example.com`; `10.1.2.80`; `/tmp/my.sock`|`Recommended`||
456
+
|[`server.address`](/docs/attributes-registry/server.md)| string |GenAI server address. [4]|`example.com`; `10.1.2.80`; `/tmp/my.sock`|`Recommended`||
457
457
458
458
**[1]:** 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.
Copy file name to clipboardexpand all lines: docs/gen-ai/gen-ai-spans.md
+20-2
Original file line number
Diff line number
Diff line change
@@ -52,6 +52,8 @@ These attributes track input data and metadata for a request to an GenAI model.
52
52
|[`gen_ai.operation.name`](/docs/attributes-registry/gen-ai.md)| string | The name of the operation being performed. [1]|`chat`; `text_completion`|`Required`||
53
53
|[`gen_ai.request.model`](/docs/attributes-registry/gen-ai.md)| string | The name of the GenAI model a request is being made to. [2]|`gpt-4`|`Required`||
54
54
|[`gen_ai.system`](/docs/attributes-registry/gen-ai.md)| string | The Generative AI product as identified by the client or server instrumentation. [3]|`openai`|`Required`||
55
+
|[`error.type`](/docs/attributes-registry/error.md)| string | Describes a class of error the operation ended with. [4]|`timeout`; `java.net.UnknownHostException`; `server_certificate_invalid`; `500`|`Conditionally Required` if the operation ended in an error ||
56
+
|[`server.port`](/docs/attributes-registry/server.md)| int | GenAI server port. [5]|`80`; `8080`; `443`|`Conditionally Required` If `server.address` is set. ||
55
57
|[`gen_ai.request.frequency_penalty`](/docs/attributes-registry/gen-ai.md)| double | The frequency penalty setting for the GenAI request. |`0.1`|`Recommended`||
56
58
|[`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`||
57
59
|[`gen_ai.request.presence_penalty`](/docs/attributes-registry/gen-ai.md)| double | The presence penalty setting for the GenAI request. |`0.1`|`Recommended`||
@@ -61,9 +63,10 @@ These attributes track input data and metadata for a request to an GenAI model.
61
63
|[`gen_ai.request.top_p`](/docs/attributes-registry/gen-ai.md)| double | The top_p sampling setting for the GenAI request. |`1.0`|`Recommended`||
62
64
|[`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"]`|`Recommended`||
63
65
|[`gen_ai.response.id`](/docs/attributes-registry/gen-ai.md)| string | The unique identifier for the completion. |`chatcmpl-123`|`Recommended`||
64
-
|[`gen_ai.response.model`](/docs/attributes-registry/gen-ai.md)| string | The name of the model that generated the response. [4]|`gpt-4-0613`|`Recommended`||
66
+
|[`gen_ai.response.model`](/docs/attributes-registry/gen-ai.md)| string | The name of the model that generated the response. [6]|`gpt-4-0613`|`Recommended`||
65
67
|[`gen_ai.usage.input_tokens`](/docs/attributes-registry/gen-ai.md)| int | The number of tokens used in the GenAI input (prompt). |`100`|`Recommended`||
66
68
|[`gen_ai.usage.output_tokens`](/docs/attributes-registry/gen-ai.md)| int | The number of tokens used in the GenAI response (completion). |`180`|`Recommended`||
69
+
|[`server.address`](/docs/attributes-registry/server.md)| string | GenAI server address. [7]|`example.com`; `10.1.2.80`; `/tmp/my.sock`|`Recommended`||
67
70
68
71
**[1]:** 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.
69
72
@@ -79,8 +82,23 @@ is set to `openai` based on the instrumentation's best knowledge.
79
82
For custom model, a custom friendly name SHOULD be used.
80
83
If none of these options apply, the `gen_ai.system` SHOULD be set to `_OTHER`.
81
84
82
-
**[4]:** 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.
85
+
**[4]:** The `error.type` SHOULD match the error code returned by the Generative AI provider or the client library,
86
+
the canonical name of exception that occurred, or another low-cardinality error identifier.
87
+
Instrumentations SHOULD document the list of errors they report.
83
88
89
+
**[5]:** 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.
90
+
91
+
**[6]:** 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.
92
+
93
+
**[7]:** 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.
94
+
95
+
96
+
97
+
`error.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.
98
+
99
+
| Value | Description | Stability |
100
+
|---|---|---|
101
+
|`_OTHER`| A fallback error value to be used when the instrumentation doesn't define a custom value. ||
84
102
85
103
86
104
`gen_ai.operation.name` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.
0 commit comments