Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
005a551
Define dynamic request attribute for Google generative AI systems and…
michaelsafyan Apr 16, 2025
0e1f9fc
Add a changelog entry.
michaelsafyan Apr 16, 2025
2f02d20
Merge branch 'open-telemetry:main' into gcp_genai_request_star_attrib…
michaelsafyan Apr 16, 2025
8833c97
Fix lint issue.
michaelsafyan Apr 16, 2025
e7b9410
Merge branch 'main' into gcp_genai_request_star_attributes
michaelsafyan Apr 17, 2025
194362b
Update name, type, and add comments in response to PR feedback.
michaelsafyan Apr 17, 2025
1119ed3
Fix typo 'to to'.
michaelsafyan Apr 17, 2025
5265266
Merge branch 'main' into gcp_genai_request_star_attributes
michaelsafyan Apr 17, 2025
c9ba89b
Update attribute 'brief' description per PR feedback.
michaelsafyan Apr 17, 2025
d62d193
Merge branch 'main' into gcp_genai_request_star_attributes
michaelsafyan Apr 21, 2025
6748c88
Merge branch 'open-telemetry:main' into gcp_genai_request_star_attrib…
michaelsafyan Apr 25, 2025
a750ee0
Update definition per feedback in LLM SIG.
michaelsafyan Apr 25, 2025
9b2be36
Merge and resolve conflicts.
michaelsafyan May 13, 2025
dd4a6f3
Updated per PR feedback.
michaelsafyan May 13, 2025
e59f038
Make name alignment with proto comment more brief
Rima-ag Feb 28, 2026
e34e86c
Make name alignment with proto comment more brief
Rima-ag Feb 28, 2026
c7a7d24
Merge main into gcp_genai_request_star_attributes_fork
Rima-ag Feb 28, 2026
4b00cca
Add SemConv GenAI as gcp area owner
Rima-ag Feb 28, 2026
7df0e50
Address CI failures
Rima-ag Mar 1, 2026
b987a67
Fix changelog
Rima-ag Mar 1, 2026
6f8e2a7
Fix google.genai.types.* format in yaml
Rima-ag Mar 1, 2026
880fe29
[google-genai] Add standard definitions to Google GenAI semconv
Rima-ag Mar 6, 2026
a87fd5c
Add entry in Changelog
Rima-ag Mar 8, 2026
0c6a783
Run checks
Rima-ag Mar 8, 2026
b8eacea
Merge branch 'main' into init-gcp-genai
Rima-ag Mar 8, 2026
5a03c06
Add pointer to Google GenAI docs
Rima-ag Mar 8, 2026
1b36a7a
Add span name and embeddings section
Rima-ag Mar 8, 2026
d478e88
fix typo
Rima-ag Mar 8, 2026
ab98e65
Make check fixes
Rima-ag Mar 8, 2026
3fb9998
Convert config into a templated attribute
Rima-ag Mar 16, 2026
61bd11a
Remove gcp.client.service
Rima-ag Mar 16, 2026
f27654d
Update changelog
Rima-ag Mar 16, 2026
2d26c81
Merge branch 'init-gcp-genai' into gcp_genai_request_star_attributes_…
Rima-ag Mar 16, 2026
d40b761
fix lint
Rima-ag Mar 16, 2026
32efcfa
Use template[any] instead of template[string]
Rima-ag Mar 17, 2026
0c4c970
remove gcp/gen-ai.yaml
Rima-ag Mar 17, 2026
21521af
Revert adding owner to gcp area
Rima-ag Mar 20, 2026
aba0847
Rename file and replace gen_ai.system by gen_ai.provider.name
Rima-ag Mar 29, 2026
6484955
Merge branch 'init-gcp-genai' into gcp_genai_request_star_attributes_…
Rima-ag Mar 29, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .chloggen/gcp_genai_request_star_attributes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
change_type: enhancement
component: gen-ai
note: Define attribute for Google generative AI operation request configuration.
issues: [2053]
subtext: Defines `gcp.gen_ai.operation.config` as a templated string for recording a subset of operation configuration options.
4 changes: 4 additions & 0 deletions .chloggen/init-gcp-genai.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
change_type: enhancement
component: gen-ai
note: Define common span attributes for Google generative AI
issues: [2053]
1 change: 1 addition & 0 deletions docs/gen-ai/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Technology specific semantic conventions are defined for the following GenAI sys
* [Anthropic](./anthropic.md): Semantic Conventions for Anthropic.
* [Azure AI Inference](./azure-ai-inference.md): Semantic Conventions for Azure AI Inference.
* [AWS Bedrock](./aws-bedrock.md): Semantic Conventions for AWS Bedrock.
* [Google GenAI](./google-genai.md): Semantic Conventions for Gemini and Vertex AI.
* [OpenAI](./openai.md): Semantic Conventions for OpenAI.

See also:
Expand Down
289 changes: 289 additions & 0 deletions docs/gen-ai/google-genai.md

Large diffs are not rendered by default.

44 changes: 44 additions & 0 deletions docs/registry/attributes/gcp.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- [GCP Client Attributes](#gcp-client-attributes)
- [GCP - Google Cloud Run Attributes](#gcp---google-cloud-run-attributes)
- [GCP - Google Compute Engine (GCE) Attributes](#gcp---google-compute-engine-gce-attributes)
- [Generative AI Attributes](#generative-ai-attributes)

## GCP - AppHub Attributes

Expand Down Expand Up @@ -177,3 +178,46 @@ This document defines attributes for Google Compute Engine (GCE).
| <a id="gcp-gce-instance-group-manager-name" href="#gcp-gce-instance-group-manager-name">`gcp.gce.instance_group_manager.name`</a> | ![Development](https://img.shields.io/badge/-development-blue) | string | The name of the Instance Group Manager (IGM) that manages this VM, if any. | `web-igm`; `my-managed-group` |
| <a id="gcp-gce-instance-group-manager-region" href="#gcp-gce-instance-group-manager-region">`gcp.gce.instance_group_manager.region`</a> | ![Development](https://img.shields.io/badge/-development-blue) | string | The region of a **regional** Instance Group Manager (e.g., `us-central1`). Set this **only** when the IGM is regional. | `us-central1`; `europe-west1` |
| <a id="gcp-gce-instance-group-manager-zone" href="#gcp-gce-instance-group-manager-zone">`gcp.gce.instance_group_manager.zone`</a> | ![Development](https://img.shields.io/badge/-development-blue) | string | The zone of a **zonal** Instance Group Manager (e.g., `us-central1-a`). Set this **only** when the IGM is zonal. | `us-central1-a`; `europe-west1-b` |

## Generative AI Attributes

This documents defines attributes for Google generative AI systems.

**Attributes:**

| Key | Stability | Value Type | Description | Example Values |
| --- | --- | --- | --- | --- |
| <a id="gcp-gen-ai-operation-config" href="#gcp-gen-ai-operation-config">`gcp.gen_ai.operation.config.<key>`</a> | ![Development](https://img.shields.io/badge/-development-blue) | template[any] | Operation-specific request configuration options for Google generative AI operations, the `<key>` being the configuration name, the value being the corresponding configuration value. [6] | A config `audioTimestamp` with value `true` SHOULD be recorded as the<br>`gcp.gen_ai.operation.config.audioTimestamp` attribute with value `true`.; A config `safetySettings` with value `[{"threshold":"OFF"}]` SHOULD be recorded as the<br>`gcp.gen_ai.operation.config.safetySettings` attribute with value:`[{"threshold":"OFF"}]`; A config `thinkingConfig` with value `{"includeThoughts":true}` SHOULD be recorded as the<br>`gcp.gen_ai.operation.config.thinkingConfig` attribute with value:`{"includeThoughts":"true"}` |

**[6] `gcp.gen_ai.operation.config.<key>`:** The available `<key>` values are dependent on `gen_ai.operation.name` and SHOULD
correspond to fields on the operation-specific `*Config` data structure in the
Google Gen AI SDK. The Google Gen AI SDK provides these `*Config` data structures
in multiple languages, generated from a common source of truth. See
`google.genai.types.*` in <https://github.com/googleapis/python-genai> and
`com.google.genai.types.*` in <https://github.com/googleapis/java-genai> for examples.

Instrumentations SHOULD record only an allowlisted subset of request configuration.
Each allowlisted field SHOULD be recorded as a separate
`gcp.gen_ai.operation.config.<key>` attribute where `<key>` is the configuration
name and the attribute value is the corresponding config value.

Scalar values SHOULD be recorded using the corresponding scalar type.
Structured values such as objects and arrays SHOULD be recorded in structured
form when supported. When recorded on spans, structured values MAY be recorded as
JSON strings if structured format is not supported and SHOULD be recorded in
structured form otherwise. The recorded fields also SHOULD NOT overlap with
configuration that has already been captured elsewhere through standard Semantic
Conventions.

The `<key>` names and any JSON encoding SHOULD align with the expectations of
proto3 JSON encoding <https://protobuf.dev/programming-guides/proto3/#json>; for
example, fields that represent a timestamp in the local language should be mapped
to the proto3 JSON encoding of `google.protobuf.Timestamp` (i.e. RFC 3339 date
format) per the specification given in
<https://protobuf.dev/reference/protobuf/google.protobuf/#timestamp>.

Instrumentations SHOULD NOT populate this attribute by default. Rather,
instrumentations SHOULD provide an opt-in mechanism through which the config
information can be dumped into this field as a tool for debugging and as an escape
hatch for the subset of configuration that is not yet representable using
standardized conventions.
55 changes: 55 additions & 0 deletions model/gcp/registry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -341,3 +341,58 @@ groups:
The region of a **regional** Instance Group Manager (e.g., `us-central1`).
Set this **only** when the IGM is regional.
examples: ['us-central1', 'europe-west1']

- id: registry.gcp.gen_ai
type: attribute_group
display_name: Generative AI Attributes
brief: >
This documents defines attributes for Google generative AI systems.
stability: development
attributes:
- id: gcp.gen_ai.operation.config
Comment thread
Rima-ag marked this conversation as resolved.
stability: development
type: template[any]
brief: Operation-specific request configuration options for Google generative AI operations, the `<key>` being the configuration name, the value being the corresponding configuration value.
examples:
- |
A config `audioTimestamp` with value `true` SHOULD be recorded as the
`gcp.gen_ai.operation.config.audioTimestamp` attribute with value `true`.
- |
A config `safetySettings` with value `[{"threshold":"OFF"}]` SHOULD be recorded as the
`gcp.gen_ai.operation.config.safetySettings` attribute with value:`[{"threshold":"OFF"}]`
- |
A config `thinkingConfig` with value `{"includeThoughts":true}` SHOULD be recorded as the
`gcp.gen_ai.operation.config.thinkingConfig` attribute with value:`{"includeThoughts":"true"}`
note: |
The available `<key>` values are dependent on `gen_ai.operation.name` and SHOULD
correspond to fields on the operation-specific `*Config` data structure in the
Google Gen AI SDK. The Google Gen AI SDK provides these `*Config` data structures
in multiple languages, generated from a common source of truth. See
`google.genai.types.*` in <https://github.com/googleapis/python-genai> and
`com.google.genai.types.*` in <https://github.com/googleapis/java-genai> for examples.

Instrumentations SHOULD record only an allowlisted subset of request configuration.
Each allowlisted field SHOULD be recorded as a separate
`gcp.gen_ai.operation.config.<key>` attribute where `<key>` is the configuration
name and the attribute value is the corresponding config value.

Scalar values SHOULD be recorded using the corresponding scalar type.
Structured values such as objects and arrays SHOULD be recorded in structured
form when supported. When recorded on spans, structured values MAY be recorded as
JSON strings if structured format is not supported and SHOULD be recorded in
structured form otherwise. The recorded fields also SHOULD NOT overlap with
configuration that has already been captured elsewhere through standard Semantic
Conventions.

The `<key>` names and any JSON encoding SHOULD align with the expectations of
proto3 JSON encoding <https://protobuf.dev/programming-guides/proto3/#json>; for
example, fields that represent a timestamp in the local language should be mapped
to the proto3 JSON encoding of `google.protobuf.Timestamp` (i.e. RFC 3339 date
format) per the specification given in
<https://protobuf.dev/reference/protobuf/google.protobuf/#timestamp>.

Instrumentations SHOULD NOT populate this attribute by default. Rather,
instrumentations SHOULD provide an opt-in mechanism through which the config
information can be dumped into this field as a tool for debugging and as an escape
hatch for the subset of configuration that is not yet representable using
standardized conventions.
14 changes: 14 additions & 0 deletions model/gen-ai/spans.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,20 @@ groups:
requirement_level:
conditionally_required: If not default (443).

- id: span.gen_ai.gcp.client
type: span
extends: attributes.gen_ai.inference.client
stability: development
brief: Semantic Conventions for model inference spans when calling Google systems.
span_kind: client
note: |
`gen_ai.provider.name` MUST be set to `"gcp.gen_ai"`, `"gcp.vertex_ai"`, or `"gcp.gemini"` and SHOULD be provided **at span creation time**.

**Span name** SHOULD be `{gen_ai.operation.name} {gen_ai.request.model}`.
attributes:
- ref: gcp.gen_ai.operation.config
requirement_level: opt_in

- id: span.gen_ai.embeddings.client
type: span
span_kind: client
Expand Down
Loading