Skip to content

Commit 8638e7b

Browse files
author
Liudmila Molkova
authored
Update GenAI conventions based on system-specific naming guidance (#2046)
1 parent 16c9c52 commit 8638e7b

File tree

23 files changed

+1041
-579
lines changed

23 files changed

+1041
-579
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
change_type: breaking
2+
component: gen-ai
3+
note: |
4+
Follow system-specific naming policy in GenAI semantic conventions.
5+
- Rename `gen_ai.system` to `gen_ai.provider.name`
6+
- Remove `gen_ai` prefix from `gen_ai.openai.*` attributes.
7+
- Rename `az.ai.*` attribute names to `azure.ai.*`.
8+
9+
issues: [ 2046 ]
10+
subtext:

.github/ISSUE_TEMPLATE/bug_report.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ body:
7272
- area:network
7373
- area:nodejs
7474
- area:oci
75+
- area:openai
7576
- area:opentracing
7677
- area:os
7778
- area:otel

.github/ISSUE_TEMPLATE/change_proposal.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ body:
6464
- area:network
6565
- area:nodejs
6666
- area:oci
67+
- area:openai
6768
- area:opentracing
6869
- area:os
6970
- area:otel

.github/ISSUE_TEMPLATE/new-conventions.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ body:
7575
- area:network
7676
- area:nodejs
7777
- area:oci
78+
- area:openai
7879
- area:opentracing
7980
- area:os
8081
- area:otel

docs/gen-ai/README.md

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,25 @@ linkTitle: Generative AI
77
**Status**: [Development][DocumentStatus]
88

99
> [!Warning]
10-
> The semantic conventions for GenAI and LLM are currently in development.
11-
> We encourage instrumentation libraries and telemetry consumers developers to
12-
> use the conventions in limited non-critical workloads and share the feedback
10+
>
11+
> Existing GenAI instrumentations that are using
12+
> [v1.36.0 of this document](https://github.com/open-telemetry/semantic-conventions/blob/v1.36.0/docs/gen-ai/README.md)
13+
> (or prior):
14+
>
15+
> * SHOULD NOT change the version of the GenAI conventions that they emit by default.
16+
> Conventions include, but are not limited to, attributes, metric, span and event names,
17+
> span kind and unit of measure.
18+
> * SHOULD introduce an environment variable `OTEL_SEMCONV_STABILITY_OPT_IN`
19+
> as a comma-separated list of category-specific values. The list of values
20+
> includes:
21+
> * `gen_ai_latest_experimental` - emit the latest experimental version of
22+
> GenAI conventions (supported by the instrumentation) and do not emit the
23+
> old one (v1.36.0 or prior).
24+
> * The default behavior is to continue emitting whatever version of the GenAI
25+
> conventions the instrumentation was emitting (1.36.0 or prior).
26+
>
27+
> This transition plan will be updated to include stable version before the
28+
> GenAI conventions are marked as stable.
1329
1430
Semantic conventions for Generative AI operations are defined for the following signals:
1531

docs/gen-ai/aws-bedrock.md

Lines changed: 58 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,33 @@ linkTitle: AWS Bedrock
66

77
**Status**: [Development][DocumentStatus]
88

9+
> [!Warning]
10+
>
11+
> Existing GenAI instrumentations that are using
12+
> [v1.36.0 of this document](https://github.com/open-telemetry/semantic-conventions/blob/v1.36.0/docs/gen-ai/README.md)
13+
> (or prior):
14+
>
15+
> * SHOULD NOT change the version of the GenAI conventions that they emit by default.
16+
> Conventions include, but are not limited to, attributes, metric, span and event names,
17+
> span kind and unit of measure.
18+
> * SHOULD introduce an environment variable `OTEL_SEMCONV_STABILITY_OPT_IN`
19+
> as a comma-separated list of category-specific values. The list of values
20+
> includes:
21+
> * `gen_ai_latest_experimental` - emit the latest experimental version of
22+
> GenAI conventions (supported by the instrumentation) and do not emit the
23+
> old one (v1.36.0 or prior).
24+
> * The default behavior is to continue emitting whatever version of the GenAI
25+
> conventions the instrumentation was emitting (1.34.0 or prior).
26+
>
27+
> This transition plan will be updated to include stable version before the
28+
> GenAI conventions are marked as stable.
29+
30+
## AWS Bedrock Spans
31+
932
The Semantic Conventions for [AWS Bedrock](https://aws.amazon.com/bedrock/) extend and override the semantic conventions
1033
for [Gen AI Spans](gen-ai-spans.md).
1134

12-
`gen_ai.system` MUST be set to `"aws.bedrock"`.
13-
14-
## AWS Bedrock Spans
35+
`gen_ai.provider.name` MUST be set to `"aws.bedrock"`.
1536

1637
These attributes track input data and metadata for a request to an AWS Bedrock model. The attributes include general Generative AI
1738
attributes and ones specific the AWS Bedrock.
@@ -35,7 +56,7 @@ Describes an AWS Bedrock operation span.
3556
|---|---|---|---|---|---|
3657
| [`aws.bedrock.guardrail.id`](/docs/registry/attributes/aws.md) | string | The unique identifier of the AWS Bedrock Guardrail. A [guardrail](https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails.html) helps safeguard and prevent unwanted behavior from model responses or user messages. | `sgi5gkybzqak` | `Required` | ![Development](https://img.shields.io/badge/-development-blue) |
3758
| [`gen_ai.operation.name`](/docs/registry/attributes/gen-ai.md) | string | The name of the operation being performed. [1] | `chat`; `generate_content`; `text_completion` | `Required` | ![Development](https://img.shields.io/badge/-development-blue) |
38-
| [`gen_ai.system`](/docs/registry/attributes/gen-ai.md) | string | The Generative AI product as identified by the client or server instrumentation. [2] | `openai` | `Required` | ![Development](https://img.shields.io/badge/-development-blue) |
59+
| [`gen_ai.provider.name`](/docs/registry/attributes/gen-ai.md) | string | The Generative AI provider as identified by the client or server instrumentation. [2] | `openai`; `gcp.gen_ai`; `gcp.vertex_ai` | `Required` | ![Development](https://img.shields.io/badge/-development-blue) |
3960
| [`error.type`](/docs/registry/attributes/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 | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
4061
| [`gen_ai.conversation.id`](/docs/registry/attributes/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 | ![Development](https://img.shields.io/badge/-development-blue) |
4162
| [`gen_ai.output.type`](/docs/registry/attributes/gen-ai.md) | string | Represents the content type requested by the client. [5] | `text`; `json`; `image` | `Conditionally Required` [6] | ![Development](https://img.shields.io/badge/-development-blue) |
@@ -60,17 +81,24 @@ Describes an AWS Bedrock operation span.
6081

6182
**[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.
6283

63-
**[2] `gen_ai.system`:** The `gen_ai.system` describes a family of GenAI models with specific model identified
64-
by `gen_ai.request.model` and `gen_ai.response.model` attributes.
84+
**[2] `gen_ai.provider.name`:** The attribute SHOULD be set based on the instrumentation's best
85+
knowledge and may differ from the actual model provider.
86+
87+
Multiple providers, including Azure OpenAI, Gemini, and AI hosting platforms
88+
are accessible using the OpenAI REST API and corresponding client libraries,
89+
but may proxy or host models from different providers.
6590

66-
The actual GenAI product may differ from the one identified by the client.
67-
Multiple systems, including Azure OpenAI and Gemini, are accessible by OpenAI client
68-
libraries. In such cases, the `gen_ai.system` is set to `openai` based on the
69-
instrumentation's best knowledge, instead of the actual system. The `server.address`
70-
attribute may help identify the actual system in use for `openai`.
91+
The `gen_ai.request.model`, `gen_ai.response.model`, and `server.address`
92+
attributes may help identify the actual system in use.
7193

72-
For custom model, a custom friendly name SHOULD be used.
73-
If none of these options apply, the `gen_ai.system` SHOULD be set to `_OTHER`.
94+
The `gen_ai.provider.name` attribute acts as a discriminator that
95+
identifies the GenAI telemetry format flavor specific to that provider
96+
within GenAI semantic conventions.
97+
It SHOULD be set consistently with provider-specific attributes and signals.
98+
For example, GenAI spans, metrics, and events related to AWS Bedrock
99+
should have the `gen_ai.provider.name` set to `aws.bedrock` and include
100+
applicable `aws.bedrock.*` attributes and are not expected to include
101+
`openai.*` attributes.
74102

75103
**[3] `error.type`:** The `error.type` SHOULD match the error code returned by the Generative AI provider or the client library,
76104
the canonical name of exception that occurred, or another low-cardinality error identifier.
@@ -139,31 +167,31 @@ Additional output format details may be recorded in the future in the `gen_ai.ou
139167

140168
---
141169

142-
`gen_ai.system` 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.
170+
`gen_ai.provider.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.
143171

144172
| Value | Description | Stability |
145173
|---|---|---|
146-
| `anthropic` | Anthropic | ![Development](https://img.shields.io/badge/-development-blue) |
147-
| `aws.bedrock` | AWS Bedrock | ![Development](https://img.shields.io/badge/-development-blue) |
174+
| `anthropic` | [Anthropic](https://www.anthropic.com/) | ![Development](https://img.shields.io/badge/-development-blue) |
175+
| `aws.bedrock` | [AWS Bedrock](https://aws.amazon.com/bedrock) | ![Development](https://img.shields.io/badge/-development-blue) |
148176
| `azure.ai.inference` | Azure AI Inference | ![Development](https://img.shields.io/badge/-development-blue) |
149-
| `azure.ai.openai` | Azure OpenAI | ![Development](https://img.shields.io/badge/-development-blue) |
150-
| `cohere` | Cohere | ![Development](https://img.shields.io/badge/-development-blue) |
151-
| `deepseek` | DeepSeek | ![Development](https://img.shields.io/badge/-development-blue) |
152-
| `gcp.gemini` | Gemini [11] | ![Development](https://img.shields.io/badge/-development-blue) |
177+
| `azure.ai.openai` | [Azure OpenAI](https://azure.microsoft.com/products/ai-services/openai-service/) | ![Development](https://img.shields.io/badge/-development-blue) |
178+
| `cohere` | [Cohere](https://cohere.com/) | ![Development](https://img.shields.io/badge/-development-blue) |
179+
| `deepseek` | [DeepSeek](https://www.deepseek.com/) | ![Development](https://img.shields.io/badge/-development-blue) |
180+
| `gcp.gemini` | [Gemini](https://cloud.google.com/products/gemini) [11] | ![Development](https://img.shields.io/badge/-development-blue) |
153181
| `gcp.gen_ai` | Any Google generative AI endpoint [12] | ![Development](https://img.shields.io/badge/-development-blue) |
154-
| `gcp.vertex_ai` | Vertex AI [13] | ![Development](https://img.shields.io/badge/-development-blue) |
155-
| `groq` | Groq | ![Development](https://img.shields.io/badge/-development-blue) |
156-
| `ibm.watsonx.ai` | IBM Watsonx AI | ![Development](https://img.shields.io/badge/-development-blue) |
157-
| `mistral_ai` | Mistral AI | ![Development](https://img.shields.io/badge/-development-blue) |
158-
| `openai` | OpenAI | ![Development](https://img.shields.io/badge/-development-blue) |
159-
| `perplexity` | Perplexity | ![Development](https://img.shields.io/badge/-development-blue) |
160-
| `xai` | xAI | ![Development](https://img.shields.io/badge/-development-blue) |
182+
| `gcp.vertex_ai` | [Vertex AI](https://cloud.google.com/vertex-ai) [13] | ![Development](https://img.shields.io/badge/-development-blue) |
183+
| `groq` | [Groq](https://groq.com/) | ![Development](https://img.shields.io/badge/-development-blue) |
184+
| `ibm.watsonx.ai` | [IBM Watsonx AI](https://www.ibm.com/products/watsonx-ai) | ![Development](https://img.shields.io/badge/-development-blue) |
185+
| `mistral_ai` | [Mistral AI](https://mistral.ai/) | ![Development](https://img.shields.io/badge/-development-blue) |
186+
| `openai` | [OpenAI](https://openai.com/) | ![Development](https://img.shields.io/badge/-development-blue) |
187+
| `perplexity` | [Perplexity](https://www.perplexity.ai/) | ![Development](https://img.shields.io/badge/-development-blue) |
188+
| `x_ai` | [xAI](https://x.ai/) | ![Development](https://img.shields.io/badge/-development-blue) |
161189

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.'.
190+
**[11]:** Used when accessing the 'generativelanguage.googleapis.com' endpoint. Also known as the AI Studio API.
163191

164-
**[12]:** May be used when specific backend is unknown. May use common attributes prefixed with 'gcp.gen_ai.'.
192+
**[12]:** May be used when specific backend is unknown.
165193

166-
**[13]:** This refers to the 'aiplatform.googleapis.com' endpoint. May use common attributes prefixed with 'gcp.gen_ai.'.
194+
**[13]:** Used when accessing the 'aiplatform.googleapis.com' endpoint.
167195

168196
<!-- markdownlint-restore -->
169197
<!-- prettier-ignore-end -->

docs/gen-ai/azure-ai-inference.md

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,45 @@ linkTitle: Azure AI Inference
66

77
**Status**: [Development][DocumentStatus]
88

9+
<!-- toc -->
10+
11+
- [Spans](#spans)
12+
- [Inference](#inference)
13+
- [Embedding](#embedding)
14+
- [Metrics](#metrics)
15+
16+
<!-- tocstop -->
17+
18+
> [!Warning]
19+
>
20+
> Existing GenAI instrumentations that are using
21+
> [v1.36.0 of this document](https://github.com/open-telemetry/semantic-conventions/blob/v1.36.0/docs/gen-ai/README.md)
22+
> (or prior):
23+
>
24+
> * SHOULD NOT change the version of the GenAI conventions that they emit by default.
25+
> Conventions include, but are not limited to, attributes, metric, span and event names,
26+
> span kind and unit of measure.
27+
> * SHOULD introduce an environment variable `OTEL_SEMCONV_STABILITY_OPT_IN`
28+
> as a comma-separated list of category-specific values. The list of values
29+
> includes:
30+
> * `gen_ai_latest_experimental` - emit the latest experimental version of
31+
> GenAI conventions (supported by the instrumentation) and do not emit the
32+
> old one (v1.36.0 or prior).
33+
> * The default behavior is to continue emitting whatever version of the GenAI
34+
> conventions the instrumentation was emitting (1.36.0 or prior).
35+
>
36+
> This transition plan will be updated to include stable version before the
37+
> GenAI conventions are marked as stable.
38+
939
The Semantic Conventions for [Azure AI Inference](https://learn.microsoft.com/azure/ai-studio) extend and override the [GenAI Semantic Conventions](README.md).
1040

1141
## Spans
1242

1343
### Inference
1444

15-
<!-- semconv span.gen_ai.azure.ai.inference.client -->
45+
`gen_ai.provider.name` MUST be set to `"azure.ai.inference"` and SHOULD be provided **at span creation time**.
46+
47+
<!-- semconv span.azure.ai.inference.client -->
1648
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
1749
<!-- see templates/registry/markdown/snippet.md.j2 -->
1850
<!-- prettier-ignore-start -->
@@ -23,7 +55,7 @@ The Semantic Conventions for [Azure AI Inference](https://learn.microsoft.com/az
2355

2456
Semantic Conventions for [Azure AI Inference](https://learn.microsoft.com/azure/ai-studio/reference/reference-model-inference-api) client spans extend and override the semantic conventions for [Gen AI Spans](gen-ai-spans.md).
2557

26-
`gen_ai.system` MUST be set to `"az.ai.inference"` and SHOULD be provided **at span creation time**.
58+
`gen_ai.provider.name` MUST be set to `"azure.ai.inference"` and SHOULD be provided **at span creation time**.
2759

2860
**Span name** SHOULD be `{gen_ai.operation.name} {gen_ai.request.model}` when the
2961
model name is available and `{gen_ai.operation.name}` otherwise.

0 commit comments

Comments
 (0)