From 912d590a4a273ee54f81274aa2c91d83ffd0bd96 Mon Sep 17 00:00:00 2001 From: JWinermaSplunk Date: Wed, 15 Oct 2025 16:27:20 -0700 Subject: [PATCH 1/4] initial commit # Conflicts: # docs/registry/attributes/gen-ai.md --- .chloggen/retrieval-span-support.yaml | 22 ++++++++ docs/gen-ai/aws-bedrock.md | 1 + docs/gen-ai/azure-ai-inference.md | 1 + docs/gen-ai/gen-ai-agent-spans.md | 2 + docs/gen-ai/gen-ai-events.md | 1 + docs/gen-ai/gen-ai-metrics.md | 5 ++ docs/gen-ai/gen-ai-spans.md | 75 +++++++++++++++++++++++++++ docs/gen-ai/openai.md | 1 + model/gen-ai/registry.yaml | 24 +++++++++ model/gen-ai/spans.yaml | 22 ++++++++ 10 files changed, 154 insertions(+) create mode 100644 .chloggen/retrieval-span-support.yaml diff --git a/.chloggen/retrieval-span-support.yaml b/.chloggen/retrieval-span-support.yaml new file mode 100644 index 0000000000..dcd378d9cf --- /dev/null +++ b/.chloggen/retrieval-span-support.yaml @@ -0,0 +1,22 @@ +# Use this changelog template to create an entry for release notes. +# +# If your change doesn't affect end users you should instead start +# your pull request title with [chore] or use the "Skip Changelog" label. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: 'new_component' + +# The name of the area of concern in the attributes-registry, (e.g. http, cloud, db) +component: gen-ai + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Add retrieval span support to the gen-ai-spans semantic conventions. + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +# The values here must be integers. +issues: [2907] + +# (Optional) One or more lines of additional information to render under the primary note. +# These lines will be padded with 2 spaces and then inserted directly into the document. +# Use pipe (|) for multiline entries. +subtext: diff --git a/docs/gen-ai/aws-bedrock.md b/docs/gen-ai/aws-bedrock.md index e53f8dcdd0..0d8c679010 100644 --- a/docs/gen-ai/aws-bedrock.md +++ b/docs/gen-ai/aws-bedrock.md @@ -224,6 +224,7 @@ populating this attribute. | `execute_tool` | Execute a tool | ![Development](https://img.shields.io/badge/-development-blue) | | `generate_content` | Multimodal content generation operation such as [Gemini Generate Content](https://ai.google.dev/api/generate-content) | ![Development](https://img.shields.io/badge/-development-blue) | | `invoke_agent` | Invoke GenAI agent | ![Development](https://img.shields.io/badge/-development-blue) | +| `retrieval` | Retrieval operation such as [OpenAI Retrieval API](https://platform.openai.com/docs/guides/retrieval) | ![Development](https://img.shields.io/badge/-development-blue) | | `text_completion` | Text completions operation such as [OpenAI Completions API (Legacy)](https://platform.openai.com/docs/api-reference/completions) | ![Development](https://img.shields.io/badge/-development-blue) | --- diff --git a/docs/gen-ai/azure-ai-inference.md b/docs/gen-ai/azure-ai-inference.md index 7b71311edc..ba41983900 100644 --- a/docs/gen-ai/azure-ai-inference.md +++ b/docs/gen-ai/azure-ai-inference.md @@ -225,6 +225,7 @@ populating this attribute. | `execute_tool` | Execute a tool | ![Development](https://img.shields.io/badge/-development-blue) | | `generate_content` | Multimodal content generation operation such as [Gemini Generate Content](https://ai.google.dev/api/generate-content) | ![Development](https://img.shields.io/badge/-development-blue) | | `invoke_agent` | Invoke GenAI agent | ![Development](https://img.shields.io/badge/-development-blue) | +| `retrieval` | Retrieval operation such as [OpenAI Retrieval API](https://platform.openai.com/docs/guides/retrieval) | ![Development](https://img.shields.io/badge/-development-blue) | | `text_completion` | Text completions operation such as [OpenAI Completions API (Legacy)](https://platform.openai.com/docs/api-reference/completions) | ![Development](https://img.shields.io/badge/-development-blue) | --- diff --git a/docs/gen-ai/gen-ai-agent-spans.md b/docs/gen-ai/gen-ai-agent-spans.md index 70e0c5efc6..950b1f65f9 100644 --- a/docs/gen-ai/gen-ai-agent-spans.md +++ b/docs/gen-ai/gen-ai-agent-spans.md @@ -134,6 +134,7 @@ Instrumentations SHOULD document the list of errors they report. | `execute_tool` | Execute a tool | ![Development](https://img.shields.io/badge/-development-blue) | | `generate_content` | Multimodal content generation operation such as [Gemini Generate Content](https://ai.google.dev/api/generate-content) | ![Development](https://img.shields.io/badge/-development-blue) | | `invoke_agent` | Invoke GenAI agent | ![Development](https://img.shields.io/badge/-development-blue) | +| `retrieval` | Retrieval operation such as [OpenAI Retrieval API](https://platform.openai.com/docs/guides/retrieval) | ![Development](https://img.shields.io/badge/-development-blue) | | `text_completion` | Text completions operation such as [OpenAI Completions API (Legacy)](https://platform.openai.com/docs/api-reference/completions) | ![Development](https://img.shields.io/badge/-development-blue) | --- @@ -375,6 +376,7 @@ populating this attribute. | `execute_tool` | Execute a tool | ![Development](https://img.shields.io/badge/-development-blue) | | `generate_content` | Multimodal content generation operation such as [Gemini Generate Content](https://ai.google.dev/api/generate-content) | ![Development](https://img.shields.io/badge/-development-blue) | | `invoke_agent` | Invoke GenAI agent | ![Development](https://img.shields.io/badge/-development-blue) | +| `retrieval` | Retrieval operation such as [OpenAI Retrieval API](https://platform.openai.com/docs/guides/retrieval) | ![Development](https://img.shields.io/badge/-development-blue) | | `text_completion` | Text completions operation such as [OpenAI Completions API (Legacy)](https://platform.openai.com/docs/api-reference/completions) | ![Development](https://img.shields.io/badge/-development-blue) | --- diff --git a/docs/gen-ai/gen-ai-events.md b/docs/gen-ai/gen-ai-events.md index b0abbf9f8c..cd88db7c73 100644 --- a/docs/gen-ai/gen-ai-events.md +++ b/docs/gen-ai/gen-ai-events.md @@ -205,6 +205,7 @@ populating this attribute. | `execute_tool` | Execute a tool | ![Development](https://img.shields.io/badge/-development-blue) | | `generate_content` | Multimodal content generation operation such as [Gemini Generate Content](https://ai.google.dev/api/generate-content) | ![Development](https://img.shields.io/badge/-development-blue) | | `invoke_agent` | Invoke GenAI agent | ![Development](https://img.shields.io/badge/-development-blue) | +| `retrieval` | Retrieval operation such as [OpenAI Retrieval API](https://platform.openai.com/docs/guides/retrieval) | ![Development](https://img.shields.io/badge/-development-blue) | | `text_completion` | Text completions operation such as [OpenAI Completions API (Legacy)](https://platform.openai.com/docs/api-reference/completions) | ![Development](https://img.shields.io/badge/-development-blue) | --- diff --git a/docs/gen-ai/gen-ai-metrics.md b/docs/gen-ai/gen-ai-metrics.md index 083d1a9810..883e53822c 100644 --- a/docs/gen-ai/gen-ai-metrics.md +++ b/docs/gen-ai/gen-ai-metrics.md @@ -127,6 +127,7 @@ applicable `aws.bedrock.*` attributes and are not expected to include | `execute_tool` | Execute a tool | ![Development](https://img.shields.io/badge/-development-blue) | | `generate_content` | Multimodal content generation operation such as [Gemini Generate Content](https://ai.google.dev/api/generate-content) | ![Development](https://img.shields.io/badge/-development-blue) | | `invoke_agent` | Invoke GenAI agent | ![Development](https://img.shields.io/badge/-development-blue) | +| `retrieval` | Retrieval operation such as [OpenAI Retrieval API](https://platform.openai.com/docs/guides/retrieval) | ![Development](https://img.shields.io/badge/-development-blue) | | `text_completion` | Text completions operation such as [OpenAI Completions API (Legacy)](https://platform.openai.com/docs/api-reference/completions) | ![Development](https://img.shields.io/badge/-development-blue) | --- @@ -249,6 +250,7 @@ Instrumentations SHOULD document the list of errors they report. | `execute_tool` | Execute a tool | ![Development](https://img.shields.io/badge/-development-blue) | | `generate_content` | Multimodal content generation operation such as [Gemini Generate Content](https://ai.google.dev/api/generate-content) | ![Development](https://img.shields.io/badge/-development-blue) | | `invoke_agent` | Invoke GenAI agent | ![Development](https://img.shields.io/badge/-development-blue) | +| `retrieval` | Retrieval operation such as [OpenAI Retrieval API](https://platform.openai.com/docs/guides/retrieval) | ![Development](https://img.shields.io/badge/-development-blue) | | `text_completion` | Text completions operation such as [OpenAI Completions API (Legacy)](https://platform.openai.com/docs/api-reference/completions) | ![Development](https://img.shields.io/badge/-development-blue) | --- @@ -369,6 +371,7 @@ Instrumentations SHOULD document the list of errors they report. | `execute_tool` | Execute a tool | ![Development](https://img.shields.io/badge/-development-blue) | | `generate_content` | Multimodal content generation operation such as [Gemini Generate Content](https://ai.google.dev/api/generate-content) | ![Development](https://img.shields.io/badge/-development-blue) | | `invoke_agent` | Invoke GenAI agent | ![Development](https://img.shields.io/badge/-development-blue) | +| `retrieval` | Retrieval operation such as [OpenAI Retrieval API](https://platform.openai.com/docs/guides/retrieval) | ![Development](https://img.shields.io/badge/-development-blue) | | `text_completion` | Text completions operation such as [OpenAI Completions API (Legacy)](https://platform.openai.com/docs/api-reference/completions) | ![Development](https://img.shields.io/badge/-development-blue) | --- @@ -476,6 +479,7 @@ applicable `aws.bedrock.*` attributes and are not expected to include | `execute_tool` | Execute a tool | ![Development](https://img.shields.io/badge/-development-blue) | | `generate_content` | Multimodal content generation operation such as [Gemini Generate Content](https://ai.google.dev/api/generate-content) | ![Development](https://img.shields.io/badge/-development-blue) | | `invoke_agent` | Invoke GenAI agent | ![Development](https://img.shields.io/badge/-development-blue) | +| `retrieval` | Retrieval operation such as [OpenAI Retrieval API](https://platform.openai.com/docs/guides/retrieval) | ![Development](https://img.shields.io/badge/-development-blue) | | `text_completion` | Text completions operation such as [OpenAI Completions API (Legacy)](https://platform.openai.com/docs/api-reference/completions) | ![Development](https://img.shields.io/badge/-development-blue) | --- @@ -582,6 +586,7 @@ applicable `aws.bedrock.*` attributes and are not expected to include | `execute_tool` | Execute a tool | ![Development](https://img.shields.io/badge/-development-blue) | | `generate_content` | Multimodal content generation operation such as [Gemini Generate Content](https://ai.google.dev/api/generate-content) | ![Development](https://img.shields.io/badge/-development-blue) | | `invoke_agent` | Invoke GenAI agent | ![Development](https://img.shields.io/badge/-development-blue) | +| `retrieval` | Retrieval operation such as [OpenAI Retrieval API](https://platform.openai.com/docs/guides/retrieval) | ![Development](https://img.shields.io/badge/-development-blue) | | `text_completion` | Text completions operation such as [OpenAI Completions API (Legacy)](https://platform.openai.com/docs/api-reference/completions) | ![Development](https://img.shields.io/badge/-development-blue) | --- diff --git a/docs/gen-ai/gen-ai-spans.md b/docs/gen-ai/gen-ai-spans.md index 7f4ab2e975..707a813592 100644 --- a/docs/gen-ai/gen-ai-spans.md +++ b/docs/gen-ai/gen-ai-spans.md @@ -11,6 +11,7 @@ linkTitle: Spans - [Spans](#spans) - [Inference](#inference) - [Embeddings](#embeddings) + - [Retrievals](#retrievals) - [Execute tool span](#execute-tool-span) - [Capturing instructions, inputs, and outputs](#capturing-instructions-inputs-and-outputs) - [Full (buffered) content](#full-buffered-content) @@ -237,6 +238,7 @@ populating this attribute. | `execute_tool` | Execute a tool | ![Development](https://img.shields.io/badge/-development-blue) | | `generate_content` | Multimodal content generation operation such as [Gemini Generate Content](https://ai.google.dev/api/generate-content) | ![Development](https://img.shields.io/badge/-development-blue) | | `invoke_agent` | Invoke GenAI agent | ![Development](https://img.shields.io/badge/-development-blue) | +| `retrieval` | Retrieval operation such as [OpenAI Retrieval API](https://platform.openai.com/docs/guides/retrieval) | ![Development](https://img.shields.io/badge/-development-blue) | | `text_completion` | Text completions operation such as [OpenAI Completions API (Legacy)](https://platform.openai.com/docs/api-reference/completions) | ![Development](https://img.shields.io/badge/-development-blue) | --- @@ -349,6 +351,78 @@ Instrumentations SHOULD document the list of errors they report. | `execute_tool` | Execute a tool | ![Development](https://img.shields.io/badge/-development-blue) | | `generate_content` | Multimodal content generation operation such as [Gemini Generate Content](https://ai.google.dev/api/generate-content) | ![Development](https://img.shields.io/badge/-development-blue) | | `invoke_agent` | Invoke GenAI agent | ![Development](https://img.shields.io/badge/-development-blue) | +| `retrieval` | Retrieval operation such as [OpenAI Retrieval API](https://platform.openai.com/docs/guides/retrieval) | ![Development](https://img.shields.io/badge/-development-blue) | +| `text_completion` | Text completions operation such as [OpenAI Completions API (Legacy)](https://platform.openai.com/docs/api-reference/completions) | ![Development](https://img.shields.io/badge/-development-blue) | + + + + + + +### Retrievals + + + + + + + + +**Status:** ![Development](https://img.shields.io/badge/-development-blue) + +Describes GenAI Retrieval Span - where relevant information or context is stored in a vector database or search system to be passed to a language model at a later time. +The `gen_ai.operation.name` SHOULD be `retrieval`. +**Span name** SHOULD be `{gen_ai.operation.name} {gen_ai.request.model}`. + +**Span kind** SHOULD be `CLIENT`. + +**Span status** SHOULD follow the [Recording Errors](/docs/general/recording-errors.md) document. + +| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | +|---|---|---|---|---|---| +| [`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) | +| [`error.type`](/docs/registry/attributes/error.md) | string | Describes a class of error the operation ended with. [2] | `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) | +| [`gen_ai.request.model`](/docs/registry/attributes/gen-ai.md) | string | The name of the GenAI model a request is being made to. [3] | `gpt-4` | `Conditionally Required` If available. | ![Development](https://img.shields.io/badge/-development-blue) | +| [`server.port`](/docs/registry/attributes/server.md) | int | GenAI server port. [4] | `80`; `8080`; `443` | `Conditionally Required` If `server.address` is set. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`gen_ai.retrieval.documents_retrieved`](/docs/registry/attributes/gen-ai.md) | int | The number of documents retrieved. | `5`; `10` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) | +| [`gen_ai.retrieval.top_k`](/docs/registry/attributes/gen-ai.md) | int | The number of documents to retrieve. | `5`; `10` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) | +| [`gen_ai.retrieval.type`](/docs/registry/attributes/gen-ai.md) | string | The type of retrieval being performed. | `similarity`; `hybrid` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) | +| [`gen_ai.retrieval.vector_store`](/docs/registry/attributes/gen-ai.md) | string | The vector store being used for retrieval. | `faiss`; `pinecone` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) | +| [`server.address`](/docs/registry/attributes/server.md) | string | GenAI server address. [5] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | + +**[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. + +**[2] `error.type`:** The `error.type` SHOULD match the error code returned by the Generative AI provider or the client library, +the canonical name of exception that occurred, or another low-cardinality error identifier. +Instrumentations SHOULD document the list of errors they report. + +**[3] `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. + +**[4] `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. + +**[5] `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. + +--- + +`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. + +| Value | Description | Stability | +|---|---|---| +| `_OTHER` | A fallback error value to be used when the instrumentation doesn't define a custom value. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | + +--- + +`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. + +| Value | Description | Stability | +|---|---|---| +| `chat` | Chat completion operation such as [OpenAI Chat API](https://platform.openai.com/docs/api-reference/chat) | ![Development](https://img.shields.io/badge/-development-blue) | +| `create_agent` | Create GenAI agent | ![Development](https://img.shields.io/badge/-development-blue) | +| `embeddings` | Embeddings operation such as [OpenAI Create embeddings API](https://platform.openai.com/docs/api-reference/embeddings/create) | ![Development](https://img.shields.io/badge/-development-blue) | +| `execute_tool` | Execute a tool | ![Development](https://img.shields.io/badge/-development-blue) | +| `generate_content` | Multimodal content generation operation such as [Gemini Generate Content](https://ai.google.dev/api/generate-content) | ![Development](https://img.shields.io/badge/-development-blue) | +| `invoke_agent` | Invoke GenAI agent | ![Development](https://img.shields.io/badge/-development-blue) | +| `retrieval` | Retrieval operation such as [OpenAI Retrieval API](https://platform.openai.com/docs/guides/retrieval) | ![Development](https://img.shields.io/badge/-development-blue) | | `text_completion` | Text completions operation such as [OpenAI Completions API (Legacy)](https://platform.openai.com/docs/api-reference/completions) | ![Development](https://img.shields.io/badge/-development-blue) | @@ -441,6 +515,7 @@ deserialize it to an object. When recorded on spans, it MAY be recorded as a JSO | `execute_tool` | Execute a tool | ![Development](https://img.shields.io/badge/-development-blue) | | `generate_content` | Multimodal content generation operation such as [Gemini Generate Content](https://ai.google.dev/api/generate-content) | ![Development](https://img.shields.io/badge/-development-blue) | | `invoke_agent` | Invoke GenAI agent | ![Development](https://img.shields.io/badge/-development-blue) | +| `retrieval` | Retrieval operation such as [OpenAI Retrieval API](https://platform.openai.com/docs/guides/retrieval) | ![Development](https://img.shields.io/badge/-development-blue) | | `text_completion` | Text completions operation such as [OpenAI Completions API (Legacy)](https://platform.openai.com/docs/api-reference/completions) | ![Development](https://img.shields.io/badge/-development-blue) | diff --git a/docs/gen-ai/openai.md b/docs/gen-ai/openai.md index 8721b718e6..4a4b81facd 100644 --- a/docs/gen-ai/openai.md +++ b/docs/gen-ai/openai.md @@ -230,6 +230,7 @@ populating this attribute. | `execute_tool` | Execute a tool | ![Development](https://img.shields.io/badge/-development-blue) | | `generate_content` | Multimodal content generation operation such as [Gemini Generate Content](https://ai.google.dev/api/generate-content) | ![Development](https://img.shields.io/badge/-development-blue) | | `invoke_agent` | Invoke GenAI agent | ![Development](https://img.shields.io/badge/-development-blue) | +| `retrieval` | Retrieval operation such as [OpenAI Retrieval API](https://platform.openai.com/docs/guides/retrieval) | ![Development](https://img.shields.io/badge/-development-blue) | | `text_completion` | Text completions operation such as [OpenAI Completions API (Legacy)](https://platform.openai.com/docs/api-reference/completions) | ![Development](https://img.shields.io/badge/-development-blue) | --- diff --git a/model/gen-ai/registry.yaml b/model/gen-ai/registry.yaml index 8b3fa51dd4..5752b3efc6 100644 --- a/model/gen-ai/registry.yaml +++ b/model/gen-ai/registry.yaml @@ -382,6 +382,10 @@ groups: value: "execute_tool" brief: 'Execute a tool' stability: development + - id: retrieval + value: "retrieval" + brief: 'Retrieval operation such as [OpenAI Retrieval API](https://platform.openai.com/docs/guides/retrieval)' + stability: development brief: The name of the operation being performed. note: > If one of the predefined values applies, but specific system uses a different name it's RECOMMENDED to document it in the semantic @@ -426,6 +430,26 @@ groups: type: int brief: The number of dimensions the resulting output embeddings should have. examples: [512, 1024] + - id: gen_ai.retrieval.type + stability: development + type: string + brief: The type of retrieval being performed. + examples: ["similarity", "hybrid"] + - id: gen_ai.retrieval.vector_store + stability: development + type: string + brief: The vector store being used for retrieval. + examples: ["faiss", "pinecone"] + - id: gen_ai.retrieval.top_k + stability: development + type: int + brief: The number of documents to retrieve. + examples: [5, 10] + - id: gen_ai.retrieval.documents_retrieved + stability: development + type: int + brief: The number of documents retrieved. + examples: [5, 10] - id: gen_ai.system_instructions stability: development type: any diff --git a/model/gen-ai/spans.yaml b/model/gen-ai/spans.yaml index 3ac2d84648..91af3a1bc9 100644 --- a/model/gen-ai/spans.yaml +++ b/model/gen-ai/spans.yaml @@ -217,6 +217,28 @@ groups: - ref: gen_ai.embeddings.dimension.count requirement_level: recommended + - id: span.gen_ai.retrieval.client + type: span + span_kind: client + stability: development + brief: > + Describes GenAI Retrieval Span - where relevant information or context is stored + in a vector database or search system to be passed to a language model at a later time. + + The `gen_ai.operation.name` SHOULD be `retrieval`. + + **Span name** SHOULD be `{gen_ai.operation.name} {gen_ai.request.model}`. + extends: attributes.gen_ai.common.client + attributes: + - ref: gen_ai.retrieval.type + requirement_level: recommended + - ref: gen_ai.retrieval.vector_store + requirement_level: recommended + - ref: gen_ai.retrieval.top_k + requirement_level: recommended + - ref: gen_ai.retrieval.documents_retrieved + requirement_level: recommended + - id: span.gen_ai.create_agent.client type: span stability: development From 64ff6d9890ce98ae016ec919a23efa6e94466fbe Mon Sep 17 00:00:00 2001 From: JWinermaSplunk Date: Fri, 21 Nov 2025 11:06:51 -0800 Subject: [PATCH 2/4] updates for db retrieval span --- docs/database/retrieval.md | 163 ++++++++++++++++++++++++++++++ docs/gen-ai/aws-bedrock.md | 1 - docs/gen-ai/azure-ai-inference.md | 1 - docs/gen-ai/gen-ai-agent-spans.md | 2 - docs/gen-ai/gen-ai-events.md | 1 - docs/gen-ai/gen-ai-metrics.md | 5 - docs/gen-ai/gen-ai-spans.md | 7 -- docs/gen-ai/openai.md | 1 - docs/registry/attributes/db.md | 111 ++++++++++---------- model/database/registry.yaml | 26 +++++ model/database/spans.yaml | 58 +++++++++++ model/gen-ai/registry.yaml | 24 ----- model/gen-ai/spans.yaml | 22 ---- 13 files changed, 307 insertions(+), 115 deletions(-) create mode 100644 docs/database/retrieval.md diff --git a/docs/database/retrieval.md b/docs/database/retrieval.md new file mode 100644 index 0000000000..98d7db8b5d --- /dev/null +++ b/docs/database/retrieval.md @@ -0,0 +1,163 @@ + + +## Retrieval Spans + + + + + + + + +**Status:** ![Development](https://img.shields.io/badge/-development-blue) + +Spans representing retrieval calls adhere to the general [Semantic Conventions for Database Client Spans](/docs/database/database-spans.md). + +Retrieval calls can be made to vector databases, search engines, and other systems optimized +for similarity search and retrieval operations. These systems are commonly used in +Retrieval-Augmented Generation (RAG) applications and semantic search. + +`db.system.name` SHOULD be set to the specific database system being used (e.g., `"pinecone"`, +`"weaviate"`, `"qdrant"`, `"chroma"`, `"milvus"`) and SHOULD be provided **at span creation time**. + +**Span name** SHOULD follow the general [database span name convention](/docs/database/database-spans.md#name). +For retrieval operations, the span name SHOULD be `{db.operation.name} {db.collection.name}` when both +are available, or `{db.operation.name}` otherwise. Common operation names include `search`, `query`, +`retrieve`, or database-specific operation names. + +**Span kind** SHOULD be `CLIENT`. It MAY be set to `INTERNAL` on spans representing +in-memory retrieval operations. + +**Span status** SHOULD follow the [Recording Errors](/docs/general/recording-errors.md) document. + +| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | +|---|---|---|---|---|---| +| [`db.system.name`](/docs/registry/attributes/db.md) | string | The database management system (DBMS) product as identified by the client instrumentation. [1] | `other_sql`; `softwareag.adabas`; `actian.ingres` | `Required` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`db.operation.name`](/docs/registry/attributes/db.md) | string | The name of the operation or command being executed. [2] | `findAndModify`; `HMSET`; `SELECT` | `Conditionally Required` [3] | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`db.response.status_code`](/docs/registry/attributes/db.md) | string | Database response status code. [4] | `102`; `ORA-17002`; `08P01`; `404` | `Conditionally Required` [5] | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`error.type`](/docs/registry/attributes/error.md) | string | Describes a class of error the operation ended with. [6] | `timeout`; `java.net.UnknownHostException`; `server_certificate_invalid`; `500` | `Conditionally Required` If and only if the operation failed. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`server.port`](/docs/registry/attributes/server.md) | int | Server port number. [7] | `80`; `8080`; `443` | `Conditionally Required` [8] | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`db.operation.batch.size`](/docs/registry/attributes/db.md) | int | The number of queries included in a batch operation. [9] | `2`; `3`; `4` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`db.query.text`](/docs/registry/attributes/db.md) | string | The query text or vector representation used for retrieval. [10] | `[0.1, 0.2, 0.3, ...]`; `search term`; `semantic query text` | `Recommended` [11] | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`db.retrieval.documents_retrieved`](/docs/registry/attributes/db.md) | int | The actual number of documents retrieved. [12] | `5`; `10`; `15` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) | +| [`db.retrieval.top_k`](/docs/registry/attributes/db.md) | int | The maximum number of results requested. [13] | `5`; `10`; `20` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) | +| [`db.retrieval.type`](/docs/registry/attributes/db.md) | string | The type of retrieval operation being performed. [14] | `similarity`; `hybrid`; `keyword` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) | +| [`server.address`](/docs/registry/attributes/server.md) | string | Name of the database host. [15] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | + +**[1] `db.system.name`:** For retrieval databases, this should be set to the specific system name (e.g., `"pinecone"`, `"weaviate"`, `"qdrant"`, `"chroma"`, `"milvus"`). + +**[2] `db.operation.name`:** It is RECOMMENDED to capture the value as provided by the application +without attempting to do any case normalization. + +The operation name SHOULD NOT be extracted from `db.query.text`, +when the database system supports query text with multiple operations +in non-batch operations. + +If spaces can occur in the operation name, multiple consecutive spaces +SHOULD be normalized to a single space. + +For batch operations, if the individual operations are known to have the same operation name +then that operation name SHOULD be used prepended by `BATCH `, +otherwise `db.operation.name` SHOULD be `BATCH` or some other database +system specific term if more applicable. + +**[3] `db.operation.name`:** If readily available and if there is a single operation name that describes the database call. + +**[4] `db.response.status_code`:** The status code returned by the database. Usually it represents an error code, but may also represent partial success, warning, or differentiate between various types of successful outcomes. +Semantic conventions for individual database systems SHOULD document what `db.response.status_code` means in the context of that system. + +**[5] `db.response.status_code`:** If the operation failed and status code is available. + +**[6] `error.type`:** The `error.type` SHOULD match the `db.response.status_code` returned by the database or the client library, or the canonical name of exception that occurred. +When using canonical exception type name, instrumentation SHOULD do the best effort to report the most relevant type. For example, if the original exception is wrapped into a generic one, the original exception SHOULD be preferred. +Instrumentations SHOULD document how `error.type` is populated. + +**[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. + +**[8] `server.port`:** If using a port other than the default port for this DBMS and if `server.address` is set. + +**[9] `db.operation.batch.size`:** Operations are only considered batches when they contain two or more operations, and so `db.operation.batch.size` SHOULD never be `1`. + +**[10] `db.query.text`:** For vector similarity searches, this may contain the query vector representation or a textual description of the query. For hybrid searches, it may contain the keyword query portion. The value should be sanitized to remove sensitive information. + +**[11] `db.query.text`:** Should be collected when available and after sanitization to exclude sensitive data. + +**[12] `db.retrieval.documents_retrieved`:** This represents the count of documents/results actually returned by the database, which may be less than `db.retrieval.top_k` if fewer matching results were found. + +**[13] `db.retrieval.top_k`:** This represents the limit parameter or top_k value specified in the retrieval query, indicating how many results the client requested. The actual number of results returned may be captured in `db.retrieval.documents_retrieved`. + +**[14] `db.retrieval.type`:** This attribute describes the retrieval strategy used by the database or vector store. Common types include similarity search, hybrid search (combining multiple strategies), keyword search, or other database-specific retrieval methods. + +**[15] `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. + +The following attributes can be important for making sampling decisions +and SHOULD be provided **at span creation time** (if provided at all): + +* [`db.operation.name`](/docs/registry/attributes/db.md) +* [`db.query.text`](/docs/registry/attributes/db.md) +* [`db.system.name`](/docs/registry/attributes/db.md) +* [`server.address`](/docs/registry/attributes/server.md) +* [`server.port`](/docs/registry/attributes/server.md) + +--- + +`db.system.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. + +| Value | Description | Stability | +|---|---|---| +| `actian.ingres` | [Actian Ingres](https://www.actian.com/databases/ingres/) | ![Development](https://img.shields.io/badge/-development-blue) | +| `aws.dynamodb` | [Amazon DynamoDB](https://aws.amazon.com/pm/dynamodb/) | ![Development](https://img.shields.io/badge/-development-blue) | +| `aws.redshift` | [Amazon Redshift](https://aws.amazon.com/redshift/) | ![Development](https://img.shields.io/badge/-development-blue) | +| `azure.cosmosdb` | [Azure Cosmos DB](https://learn.microsoft.com/azure/cosmos-db) | ![Development](https://img.shields.io/badge/-development-blue) | +| `cassandra` | [Apache Cassandra](https://cassandra.apache.org/) | ![Development](https://img.shields.io/badge/-development-blue) | +| `clickhouse` | [ClickHouse](https://clickhouse.com/) | ![Development](https://img.shields.io/badge/-development-blue) | +| `cockroachdb` | [CockroachDB](https://www.cockroachlabs.com/) | ![Development](https://img.shields.io/badge/-development-blue) | +| `couchbase` | [Couchbase](https://www.couchbase.com/) | ![Development](https://img.shields.io/badge/-development-blue) | +| `couchdb` | [Apache CouchDB](https://couchdb.apache.org/) | ![Development](https://img.shields.io/badge/-development-blue) | +| `derby` | [Apache Derby](https://db.apache.org/derby/) | ![Development](https://img.shields.io/badge/-development-blue) | +| `elasticsearch` | [Elasticsearch](https://www.elastic.co/elasticsearch) | ![Development](https://img.shields.io/badge/-development-blue) | +| `firebirdsql` | [Firebird](https://www.firebirdsql.org/) | ![Development](https://img.shields.io/badge/-development-blue) | +| `gcp.spanner` | [Google Cloud Spanner](https://cloud.google.com/spanner) | ![Development](https://img.shields.io/badge/-development-blue) | +| `geode` | [Apache Geode](https://geode.apache.org/) | ![Development](https://img.shields.io/badge/-development-blue) | +| `h2database` | [H2 Database](https://h2database.com/) | ![Development](https://img.shields.io/badge/-development-blue) | +| `hbase` | [Apache HBase](https://hbase.apache.org/) | ![Development](https://img.shields.io/badge/-development-blue) | +| `hive` | [Apache Hive](https://hive.apache.org/) | ![Development](https://img.shields.io/badge/-development-blue) | +| `hsqldb` | [HyperSQL Database](https://hsqldb.org/) | ![Development](https://img.shields.io/badge/-development-blue) | +| `ibm.db2` | [IBM Db2](https://www.ibm.com/db2) | ![Development](https://img.shields.io/badge/-development-blue) | +| `ibm.informix` | [IBM Informix](https://www.ibm.com/products/informix) | ![Development](https://img.shields.io/badge/-development-blue) | +| `ibm.netezza` | [IBM Netezza](https://www.ibm.com/products/netezza) | ![Development](https://img.shields.io/badge/-development-blue) | +| `influxdb` | [InfluxDB](https://www.influxdata.com/) | ![Development](https://img.shields.io/badge/-development-blue) | +| `instantdb` | [Instant](https://www.instantdb.com/) | ![Development](https://img.shields.io/badge/-development-blue) | +| `intersystems.cache` | [InterSystems Caché](https://www.intersystems.com/products/cache/) | ![Development](https://img.shields.io/badge/-development-blue) | +| `mariadb` | [MariaDB](https://mariadb.org/) | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| `memcached` | [Memcached](https://memcached.org/) | ![Development](https://img.shields.io/badge/-development-blue) | +| `microsoft.sql_server` | [Microsoft SQL Server](https://www.microsoft.com/sql-server) | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| `mongodb` | [MongoDB](https://www.mongodb.com/) | ![Development](https://img.shields.io/badge/-development-blue) | +| `mysql` | [MySQL](https://www.mysql.com/) | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| `neo4j` | [Neo4j](https://neo4j.com/) | ![Development](https://img.shields.io/badge/-development-blue) | +| `opensearch` | [OpenSearch](https://opensearch.org/) | ![Development](https://img.shields.io/badge/-development-blue) | +| `oracle.db` | [Oracle Database](https://www.oracle.com/database/) | ![Development](https://img.shields.io/badge/-development-blue) | +| `other_sql` | Some other SQL database. Fallback only. | ![Development](https://img.shields.io/badge/-development-blue) | +| `postgresql` | [PostgreSQL](https://www.postgresql.org/) | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| `redis` | [Redis](https://redis.io/) | ![Development](https://img.shields.io/badge/-development-blue) | +| `sap.hana` | [SAP HANA](https://www.sap.com/products/technology-platform/hana/what-is-sap-hana.html) | ![Development](https://img.shields.io/badge/-development-blue) | +| `sap.maxdb` | [SAP MaxDB](https://maxdb.sap.com/) | ![Development](https://img.shields.io/badge/-development-blue) | +| `softwareag.adabas` | [Adabas (Adaptable Database System)](https://documentation.softwareag.com/?pf=adabas) | ![Development](https://img.shields.io/badge/-development-blue) | +| `sqlite` | [SQLite](https://www.sqlite.org/) | ![Development](https://img.shields.io/badge/-development-blue) | +| `teradata` | [Teradata](https://www.teradata.com/) | ![Development](https://img.shields.io/badge/-development-blue) | +| `trino` | [Trino](https://trino.io/) | ![Development](https://img.shields.io/badge/-development-blue) | + +--- + +`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. + +| Value | Description | Stability | +|---|---|---| +| `_OTHER` | A fallback error value to be used when the instrumentation doesn't define a custom value. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | + + + + + diff --git a/docs/gen-ai/aws-bedrock.md b/docs/gen-ai/aws-bedrock.md index 0d8c679010..e53f8dcdd0 100644 --- a/docs/gen-ai/aws-bedrock.md +++ b/docs/gen-ai/aws-bedrock.md @@ -224,7 +224,6 @@ populating this attribute. | `execute_tool` | Execute a tool | ![Development](https://img.shields.io/badge/-development-blue) | | `generate_content` | Multimodal content generation operation such as [Gemini Generate Content](https://ai.google.dev/api/generate-content) | ![Development](https://img.shields.io/badge/-development-blue) | | `invoke_agent` | Invoke GenAI agent | ![Development](https://img.shields.io/badge/-development-blue) | -| `retrieval` | Retrieval operation such as [OpenAI Retrieval API](https://platform.openai.com/docs/guides/retrieval) | ![Development](https://img.shields.io/badge/-development-blue) | | `text_completion` | Text completions operation such as [OpenAI Completions API (Legacy)](https://platform.openai.com/docs/api-reference/completions) | ![Development](https://img.shields.io/badge/-development-blue) | --- diff --git a/docs/gen-ai/azure-ai-inference.md b/docs/gen-ai/azure-ai-inference.md index ba41983900..7b71311edc 100644 --- a/docs/gen-ai/azure-ai-inference.md +++ b/docs/gen-ai/azure-ai-inference.md @@ -225,7 +225,6 @@ populating this attribute. | `execute_tool` | Execute a tool | ![Development](https://img.shields.io/badge/-development-blue) | | `generate_content` | Multimodal content generation operation such as [Gemini Generate Content](https://ai.google.dev/api/generate-content) | ![Development](https://img.shields.io/badge/-development-blue) | | `invoke_agent` | Invoke GenAI agent | ![Development](https://img.shields.io/badge/-development-blue) | -| `retrieval` | Retrieval operation such as [OpenAI Retrieval API](https://platform.openai.com/docs/guides/retrieval) | ![Development](https://img.shields.io/badge/-development-blue) | | `text_completion` | Text completions operation such as [OpenAI Completions API (Legacy)](https://platform.openai.com/docs/api-reference/completions) | ![Development](https://img.shields.io/badge/-development-blue) | --- diff --git a/docs/gen-ai/gen-ai-agent-spans.md b/docs/gen-ai/gen-ai-agent-spans.md index 950b1f65f9..70e0c5efc6 100644 --- a/docs/gen-ai/gen-ai-agent-spans.md +++ b/docs/gen-ai/gen-ai-agent-spans.md @@ -134,7 +134,6 @@ Instrumentations SHOULD document the list of errors they report. | `execute_tool` | Execute a tool | ![Development](https://img.shields.io/badge/-development-blue) | | `generate_content` | Multimodal content generation operation such as [Gemini Generate Content](https://ai.google.dev/api/generate-content) | ![Development](https://img.shields.io/badge/-development-blue) | | `invoke_agent` | Invoke GenAI agent | ![Development](https://img.shields.io/badge/-development-blue) | -| `retrieval` | Retrieval operation such as [OpenAI Retrieval API](https://platform.openai.com/docs/guides/retrieval) | ![Development](https://img.shields.io/badge/-development-blue) | | `text_completion` | Text completions operation such as [OpenAI Completions API (Legacy)](https://platform.openai.com/docs/api-reference/completions) | ![Development](https://img.shields.io/badge/-development-blue) | --- @@ -376,7 +375,6 @@ populating this attribute. | `execute_tool` | Execute a tool | ![Development](https://img.shields.io/badge/-development-blue) | | `generate_content` | Multimodal content generation operation such as [Gemini Generate Content](https://ai.google.dev/api/generate-content) | ![Development](https://img.shields.io/badge/-development-blue) | | `invoke_agent` | Invoke GenAI agent | ![Development](https://img.shields.io/badge/-development-blue) | -| `retrieval` | Retrieval operation such as [OpenAI Retrieval API](https://platform.openai.com/docs/guides/retrieval) | ![Development](https://img.shields.io/badge/-development-blue) | | `text_completion` | Text completions operation such as [OpenAI Completions API (Legacy)](https://platform.openai.com/docs/api-reference/completions) | ![Development](https://img.shields.io/badge/-development-blue) | --- diff --git a/docs/gen-ai/gen-ai-events.md b/docs/gen-ai/gen-ai-events.md index cd88db7c73..b0abbf9f8c 100644 --- a/docs/gen-ai/gen-ai-events.md +++ b/docs/gen-ai/gen-ai-events.md @@ -205,7 +205,6 @@ populating this attribute. | `execute_tool` | Execute a tool | ![Development](https://img.shields.io/badge/-development-blue) | | `generate_content` | Multimodal content generation operation such as [Gemini Generate Content](https://ai.google.dev/api/generate-content) | ![Development](https://img.shields.io/badge/-development-blue) | | `invoke_agent` | Invoke GenAI agent | ![Development](https://img.shields.io/badge/-development-blue) | -| `retrieval` | Retrieval operation such as [OpenAI Retrieval API](https://platform.openai.com/docs/guides/retrieval) | ![Development](https://img.shields.io/badge/-development-blue) | | `text_completion` | Text completions operation such as [OpenAI Completions API (Legacy)](https://platform.openai.com/docs/api-reference/completions) | ![Development](https://img.shields.io/badge/-development-blue) | --- diff --git a/docs/gen-ai/gen-ai-metrics.md b/docs/gen-ai/gen-ai-metrics.md index 883e53822c..083d1a9810 100644 --- a/docs/gen-ai/gen-ai-metrics.md +++ b/docs/gen-ai/gen-ai-metrics.md @@ -127,7 +127,6 @@ applicable `aws.bedrock.*` attributes and are not expected to include | `execute_tool` | Execute a tool | ![Development](https://img.shields.io/badge/-development-blue) | | `generate_content` | Multimodal content generation operation such as [Gemini Generate Content](https://ai.google.dev/api/generate-content) | ![Development](https://img.shields.io/badge/-development-blue) | | `invoke_agent` | Invoke GenAI agent | ![Development](https://img.shields.io/badge/-development-blue) | -| `retrieval` | Retrieval operation such as [OpenAI Retrieval API](https://platform.openai.com/docs/guides/retrieval) | ![Development](https://img.shields.io/badge/-development-blue) | | `text_completion` | Text completions operation such as [OpenAI Completions API (Legacy)](https://platform.openai.com/docs/api-reference/completions) | ![Development](https://img.shields.io/badge/-development-blue) | --- @@ -250,7 +249,6 @@ Instrumentations SHOULD document the list of errors they report. | `execute_tool` | Execute a tool | ![Development](https://img.shields.io/badge/-development-blue) | | `generate_content` | Multimodal content generation operation such as [Gemini Generate Content](https://ai.google.dev/api/generate-content) | ![Development](https://img.shields.io/badge/-development-blue) | | `invoke_agent` | Invoke GenAI agent | ![Development](https://img.shields.io/badge/-development-blue) | -| `retrieval` | Retrieval operation such as [OpenAI Retrieval API](https://platform.openai.com/docs/guides/retrieval) | ![Development](https://img.shields.io/badge/-development-blue) | | `text_completion` | Text completions operation such as [OpenAI Completions API (Legacy)](https://platform.openai.com/docs/api-reference/completions) | ![Development](https://img.shields.io/badge/-development-blue) | --- @@ -371,7 +369,6 @@ Instrumentations SHOULD document the list of errors they report. | `execute_tool` | Execute a tool | ![Development](https://img.shields.io/badge/-development-blue) | | `generate_content` | Multimodal content generation operation such as [Gemini Generate Content](https://ai.google.dev/api/generate-content) | ![Development](https://img.shields.io/badge/-development-blue) | | `invoke_agent` | Invoke GenAI agent | ![Development](https://img.shields.io/badge/-development-blue) | -| `retrieval` | Retrieval operation such as [OpenAI Retrieval API](https://platform.openai.com/docs/guides/retrieval) | ![Development](https://img.shields.io/badge/-development-blue) | | `text_completion` | Text completions operation such as [OpenAI Completions API (Legacy)](https://platform.openai.com/docs/api-reference/completions) | ![Development](https://img.shields.io/badge/-development-blue) | --- @@ -479,7 +476,6 @@ applicable `aws.bedrock.*` attributes and are not expected to include | `execute_tool` | Execute a tool | ![Development](https://img.shields.io/badge/-development-blue) | | `generate_content` | Multimodal content generation operation such as [Gemini Generate Content](https://ai.google.dev/api/generate-content) | ![Development](https://img.shields.io/badge/-development-blue) | | `invoke_agent` | Invoke GenAI agent | ![Development](https://img.shields.io/badge/-development-blue) | -| `retrieval` | Retrieval operation such as [OpenAI Retrieval API](https://platform.openai.com/docs/guides/retrieval) | ![Development](https://img.shields.io/badge/-development-blue) | | `text_completion` | Text completions operation such as [OpenAI Completions API (Legacy)](https://platform.openai.com/docs/api-reference/completions) | ![Development](https://img.shields.io/badge/-development-blue) | --- @@ -586,7 +582,6 @@ applicable `aws.bedrock.*` attributes and are not expected to include | `execute_tool` | Execute a tool | ![Development](https://img.shields.io/badge/-development-blue) | | `generate_content` | Multimodal content generation operation such as [Gemini Generate Content](https://ai.google.dev/api/generate-content) | ![Development](https://img.shields.io/badge/-development-blue) | | `invoke_agent` | Invoke GenAI agent | ![Development](https://img.shields.io/badge/-development-blue) | -| `retrieval` | Retrieval operation such as [OpenAI Retrieval API](https://platform.openai.com/docs/guides/retrieval) | ![Development](https://img.shields.io/badge/-development-blue) | | `text_completion` | Text completions operation such as [OpenAI Completions API (Legacy)](https://platform.openai.com/docs/api-reference/completions) | ![Development](https://img.shields.io/badge/-development-blue) | --- diff --git a/docs/gen-ai/gen-ai-spans.md b/docs/gen-ai/gen-ai-spans.md index 707a813592..e606735587 100644 --- a/docs/gen-ai/gen-ai-spans.md +++ b/docs/gen-ai/gen-ai-spans.md @@ -238,7 +238,6 @@ populating this attribute. | `execute_tool` | Execute a tool | ![Development](https://img.shields.io/badge/-development-blue) | | `generate_content` | Multimodal content generation operation such as [Gemini Generate Content](https://ai.google.dev/api/generate-content) | ![Development](https://img.shields.io/badge/-development-blue) | | `invoke_agent` | Invoke GenAI agent | ![Development](https://img.shields.io/badge/-development-blue) | -| `retrieval` | Retrieval operation such as [OpenAI Retrieval API](https://platform.openai.com/docs/guides/retrieval) | ![Development](https://img.shields.io/badge/-development-blue) | | `text_completion` | Text completions operation such as [OpenAI Completions API (Legacy)](https://platform.openai.com/docs/api-reference/completions) | ![Development](https://img.shields.io/badge/-development-blue) | --- @@ -351,7 +350,6 @@ Instrumentations SHOULD document the list of errors they report. | `execute_tool` | Execute a tool | ![Development](https://img.shields.io/badge/-development-blue) | | `generate_content` | Multimodal content generation operation such as [Gemini Generate Content](https://ai.google.dev/api/generate-content) | ![Development](https://img.shields.io/badge/-development-blue) | | `invoke_agent` | Invoke GenAI agent | ![Development](https://img.shields.io/badge/-development-blue) | -| `retrieval` | Retrieval operation such as [OpenAI Retrieval API](https://platform.openai.com/docs/guides/retrieval) | ![Development](https://img.shields.io/badge/-development-blue) | | `text_completion` | Text completions operation such as [OpenAI Completions API (Legacy)](https://platform.openai.com/docs/api-reference/completions) | ![Development](https://img.shields.io/badge/-development-blue) | @@ -359,9 +357,6 @@ Instrumentations SHOULD document the list of errors they report. -### Retrievals - - @@ -428,7 +423,6 @@ Instrumentations SHOULD document the list of errors they report. - ### Execute tool span @@ -515,7 +509,6 @@ deserialize it to an object. When recorded on spans, it MAY be recorded as a JSO | `execute_tool` | Execute a tool | ![Development](https://img.shields.io/badge/-development-blue) | | `generate_content` | Multimodal content generation operation such as [Gemini Generate Content](https://ai.google.dev/api/generate-content) | ![Development](https://img.shields.io/badge/-development-blue) | | `invoke_agent` | Invoke GenAI agent | ![Development](https://img.shields.io/badge/-development-blue) | -| `retrieval` | Retrieval operation such as [OpenAI Retrieval API](https://platform.openai.com/docs/guides/retrieval) | ![Development](https://img.shields.io/badge/-development-blue) | | `text_completion` | Text completions operation such as [OpenAI Completions API (Legacy)](https://platform.openai.com/docs/api-reference/completions) | ![Development](https://img.shields.io/badge/-development-blue) | diff --git a/docs/gen-ai/openai.md b/docs/gen-ai/openai.md index 4a4b81facd..8721b718e6 100644 --- a/docs/gen-ai/openai.md +++ b/docs/gen-ai/openai.md @@ -230,7 +230,6 @@ populating this attribute. | `execute_tool` | Execute a tool | ![Development](https://img.shields.io/badge/-development-blue) | | `generate_content` | Multimodal content generation operation such as [Gemini Generate Content](https://ai.google.dev/api/generate-content) | ![Development](https://img.shields.io/badge/-development-blue) | | `invoke_agent` | Invoke GenAI agent | ![Development](https://img.shields.io/badge/-development-blue) | -| `retrieval` | Retrieval operation such as [OpenAI Retrieval API](https://platform.openai.com/docs/guides/retrieval) | ![Development](https://img.shields.io/badge/-development-blue) | | `text_completion` | Text completions operation such as [OpenAI Completions API (Legacy)](https://platform.openai.com/docs/api-reference/completions) | ![Development](https://img.shields.io/badge/-development-blue) | --- diff --git a/docs/registry/attributes/db.md b/docs/registry/attributes/db.md index a98f57e3c3..9829e9b7a5 100644 --- a/docs/registry/attributes/db.md +++ b/docs/registry/attributes/db.md @@ -15,20 +15,23 @@ This group defines the attributes used to describe telemetry in the context of d | Key | Stability | Value Type | Description | Example Values | |---|---|---|---|---| -| `db.client.connection.pool.name` | ![Development](https://img.shields.io/badge/-development-blue) | string | The name of the connection pool; unique within the instrumented application. In case the connection pool implementation doesn't provide a name, instrumentation SHOULD use a combination of parameters that would make the name unique, for example, combining attributes `server.address`, `server.port`, and `db.namespace`, formatted as `server.address:server.port/db.namespace`. Instrumentations that generate connection pool name following different patterns SHOULD document it. | `myDataSource` | -| `db.client.connection.state` | ![Development](https://img.shields.io/badge/-development-blue) | string | The state of a connection in the pool | `idle` | -| `db.collection.name` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | string | The name of a collection (table, container) within the database. [1] | `public.users`; `customers` | -| `db.namespace` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | string | The name of the database, fully qualified within the server address and port. [2] | `customers`; `test.users` | -| `db.operation.batch.size` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | int | The number of queries included in a batch operation. [3] | `2`; `3`; `4` | -| `db.operation.name` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | string | The name of the operation or command being executed. [4] | `findAndModify`; `HMSET`; `SELECT` | -| `db.operation.parameter.` | ![Development](https://img.shields.io/badge/-development-blue) | string | A database operation parameter, with `` being the parameter name, and the attribute value being a string representation of the parameter value. [5] | `someval`; `55` | -| `db.query.parameter.` | ![Development](https://img.shields.io/badge/-development-blue) | string | A database query parameter, with `` being the parameter name, and the attribute value being a string representation of the parameter value. [6] | `someval`; `55` | -| `db.query.summary` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | string | Low cardinality summary of a database query. [7] | `SELECT wuser_table`; `INSERT shipping_details SELECT orders`; `get user by id` | -| `db.query.text` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | string | The database query being executed. [8] | `SELECT * FROM wuser_table where username = ?`; `SET mykey ?` | -| `db.response.returned_rows` | ![Development](https://img.shields.io/badge/-development-blue) | int | Number of rows returned by the operation. | `10`; `30`; `1000` | -| `db.response.status_code` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | string | Database response status code. [9] | `102`; `ORA-17002`; `08P01`; `404` | -| `db.stored_procedure.name` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | string | The name of a stored procedure within the database. [10] | `GetCustomer` | -| `db.system.name` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | string | The database management system (DBMS) product as identified by the client instrumentation. [11] | `other_sql`; `softwareag.adabas`; `actian.ingres` | +| `db.client.connection.pool.name` | string | The name of the connection pool; unique within the instrumented application. In case the connection pool implementation doesn't provide a name, instrumentation SHOULD use a combination of parameters that would make the name unique, for example, combining attributes `server.address`, `server.port`, and `db.namespace`, formatted as `server.address:server.port/db.namespace`. Instrumentations that generate connection pool name following different patterns SHOULD document it. | `myDataSource` | ![Development](https://img.shields.io/badge/-development-blue) | +| `db.client.connection.state` | string | The state of a connection in the pool | `idle` | ![Development](https://img.shields.io/badge/-development-blue) | +| `db.collection.name` | string | The name of a collection (table, container) within the database. [1] | `public.users`; `customers` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| `db.namespace` | string | The name of the database, fully qualified within the server address and port. [2] | `customers`; `test.users` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| `db.operation.batch.size` | int | The number of queries included in a batch operation. [3] | `2`; `3`; `4` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| `db.operation.name` | string | The name of the operation or command being executed. [4] | `findAndModify`; `HMSET`; `SELECT` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| `db.operation.parameter.` | string | A database operation parameter, with `` being the parameter name, and the attribute value being a string representation of the parameter value. [5] | `someval`; `55` | ![Development](https://img.shields.io/badge/-development-blue) | +| `db.query.parameter.` | string | A database query parameter, with `` being the parameter name, and the attribute value being a string representation of the parameter value. [6] | `someval`; `55` | ![Development](https://img.shields.io/badge/-development-blue) | +| `db.query.summary` | string | Low cardinality summary of a database query. [7] | `SELECT wuser_table`; `INSERT shipping_details SELECT orders`; `get user by id` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| `db.query.text` | string | The database query being executed. [8] | `SELECT * FROM wuser_table where username = ?`; `SET mykey ?` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| `db.response.returned_rows` | int | Number of rows returned by the operation. | `10`; `30`; `1000` | ![Development](https://img.shields.io/badge/-development-blue) | +| `db.response.status_code` | string | Database response status code. [9] | `102`; `ORA-17002`; `08P01`; `404` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| `db.retrieval.documents_retrieved` | int | The actual number of documents or results retrieved by the operation. [10] | `5`; `10`; `15` | ![Development](https://img.shields.io/badge/-development-blue) | +| `db.retrieval.top_k` | int | The maximum number of results requested to be retrieved. [11] | `5`; `10`; `20`; `100` | ![Development](https://img.shields.io/badge/-development-blue) | +| `db.retrieval.type` | string | The type of retrieval operation being performed. [12] | `similarity`; `hybrid`; `keyword`; `mmr` | ![Development](https://img.shields.io/badge/-development-blue) | +| `db.stored_procedure.name` | string | The name of a stored procedure within the database. [13] | `GetCustomer` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| `db.system.name` | string | The database management system (DBMS) product as identified by the client instrumentation. [14] | `other_sql`; `softwareag.adabas`; `actian.ingres` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | **[1] `db.collection.name`:** It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization. @@ -103,7 +106,13 @@ Parameterized query text SHOULD NOT be sanitized. Even though parameterized quer **[9] `db.response.status_code`:** The status code returned by the database. Usually it represents an error code, but may also represent partial success, warning, or differentiate between various types of successful outcomes. Semantic conventions for individual database systems SHOULD document what `db.response.status_code` means in the context of that system. -**[10] `db.stored_procedure.name`:** It is RECOMMENDED to capture the value as provided by the application +**[10] `db.retrieval.documents_retrieved`:** This represents the count of documents/results actually returned by the database, which may be less than `db.retrieval.top_k` if fewer matching results were found. + +**[11] `db.retrieval.top_k`:** This represents the limit parameter or top_k value specified in the retrieval query, indicating how many results the client requested. The actual number of results returned may be captured in `db.retrieval.documents_retrieved`. + +**[12] `db.retrieval.type`:** This attribute describes the retrieval strategy used by the database or vector store. Common types include similarity search, hybrid search (combining multiple strategies), keyword search, or other database-specific retrieval methods. + +**[13] `db.stored_procedure.name`:** It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization. For batch operations, if the individual operations are known to have the same @@ -176,38 +185,38 @@ Describes deprecated database attributes. | Key | Stability | Value Type | Description | Example Values | |---|---|---|---|---| -| `db.cassandra.consistency_level` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `cassandra.consistency.level`. | string | Deprecated, use `cassandra.consistency.level` instead. | `all`; `each_quorum`; `quorum` | -| `db.cassandra.coordinator.dc` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `cassandra.coordinator.dc`. | string | Deprecated, use `cassandra.coordinator.dc` instead. | `us-west-2` | -| `db.cassandra.coordinator.id` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `cassandra.coordinator.id`. | string | Deprecated, use `cassandra.coordinator.id` instead. | `be13faa2-8574-4d71-926d-27f16cf8a7af` | -| `db.cassandra.idempotence` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `cassandra.query.idempotent`. | boolean | Deprecated, use `cassandra.query.idempotent` instead. | | -| `db.cassandra.page_size` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `cassandra.page.size`. | int | Deprecated, use `cassandra.page.size` instead. | `5000` | -| `db.cassandra.speculative_execution_count` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `cassandra.speculative_execution.count`. | int | Deprecated, use `cassandra.speculative_execution.count` instead. | `0`; `2` | -| `db.cassandra.table` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.collection.name`. | string | Deprecated, use `db.collection.name` instead. | `mytable` | -| `db.connection_string` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `server.address` and `server.port`. | string | Deprecated, use `server.address`, `server.port` attributes instead. | `Server=(localdb)\v11.0;Integrated Security=true;` | -| `db.cosmosdb.client_id` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `azure.client.id`. | string | Deprecated, use `azure.client.id` instead. | `3ba4827d-4422-483f-b59f-85b74211c11d` | -| `db.cosmosdb.connection_mode` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `azure.cosmosdb.connection.mode`. | string | Deprecated, use `azure.cosmosdb.connection.mode` instead. | `gateway`; `direct` | -| `db.cosmosdb.consistency_level` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `azure.cosmosdb.consistency.level`. | string | Deprecated, use `cosmosdb.consistency.level` instead. | `Eventual`; `ConsistentPrefix`; `BoundedStaleness`; `Strong`; `Session` | -| `db.cosmosdb.container` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.collection.name`. | string | Deprecated, use `db.collection.name` instead. | `mytable` | -| `db.cosmosdb.operation_type` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Removed, no replacement at this time. | string | Deprecated, no replacement at this time. | `batch`; `create`; `delete` | -| `db.cosmosdb.regions_contacted` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `azure.cosmosdb.operation.contacted_regions`. | string[] | Deprecated, use `azure.cosmosdb.operation.contacted_regions` instead. | `["North Central US", "Australia East", "Australia Southeast"]` | -| `db.cosmosdb.request_charge` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `azure.cosmosdb.operation.request_charge`. | double | Deprecated, use `azure.cosmosdb.operation.request_charge` instead. | `46.18`; `1.0` | -| `db.cosmosdb.request_content_length` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `azure.cosmosdb.request.body.size`. | int | Deprecated, use `azure.cosmosdb.request.body.size` instead. | | -| `db.cosmosdb.status_code` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Use `db.response.status_code` instead. | int | Deprecated, use `db.response.status_code` instead. | `200`; `201` | -| `db.cosmosdb.sub_status_code` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `azure.cosmosdb.response.sub_status_code`. | int | Deprecated, use `azure.cosmosdb.response.sub_status_code` instead. | `1000`; `1002` | -| `db.elasticsearch.cluster.name` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.namespace`. | string | Deprecated, use `db.namespace` instead. | `e9106fc68e3044f0b1475b04bf4ffd5f` | -| `db.elasticsearch.node.name` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `elasticsearch.node.name`. | string | Deprecated, use `elasticsearch.node.name` instead. | `instance-0000000001` | -| `db.elasticsearch.path_parts.` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.operation.parameter`. | string | Deprecated, use `db.operation.parameter` instead. | `test-index`; `123` | -| `db.instance.id` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Removed, no general replacement at this time. For Elasticsearch, use `db.elasticsearch.node.name` instead. | string | Deprecated, no general replacement at this time. For Elasticsearch, use `db.elasticsearch.node.name` instead. | `mysql-e26b99z.example.com` | -| `db.jdbc.driver_classname` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Removed, no replacement at this time. | string | Removed, no replacement at this time. | `org.postgresql.Driver`; `com.microsoft.sqlserver.jdbc.SQLServerDriver` | -| `db.mongodb.collection` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.collection.name`. | string | Deprecated, use `db.collection.name` instead. | `mytable` | -| `db.mssql.instance_name` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Removed, no replacement at this time. | string | Deprecated, SQL Server instance is now populated as a part of `db.namespace` attribute. | `MSSQLSERVER` | -| `db.name` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.namespace`. | string | Deprecated, use `db.namespace` instead. | `customers`; `main` | -| `db.operation` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.operation.name`. | string | Deprecated, use `db.operation.name` instead. | `findAndModify`; `HMSET`; `SELECT` | -| `db.redis.database_index` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Uncategorized. | int | Deprecated, use `db.namespace` instead. | `0`; `1`; `15` | -| `db.sql.table` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.collection.name`, but only if not extracting the value from `db.query.text`. | string | Deprecated, use `db.collection.name` instead. | `mytable` | -| `db.statement` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.query.text`. | string | The database statement being executed. | `SELECT * FROM wuser_table`; `SET mykey "WuValue"` | -| `db.system` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.system.name`. | string | Deprecated, use `db.system.name` instead. | `other_sql`; `adabas`; `intersystems_cache` | -| `db.user` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Removed, no replacement at this time. | string | Deprecated, no replacement at this time. | `readonly_user`; `reporting_user` | +| `db.cassandra.consistency_level` | string | Deprecated, use `cassandra.consistency.level` instead. | `all`; `each_quorum`; `quorum` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `cassandra.consistency.level`. | +| `db.cassandra.coordinator.dc` | string | Deprecated, use `cassandra.coordinator.dc` instead. | `us-west-2` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `cassandra.coordinator.dc`. | +| `db.cassandra.coordinator.id` | string | Deprecated, use `cassandra.coordinator.id` instead. | `be13faa2-8574-4d71-926d-27f16cf8a7af` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `cassandra.coordinator.id`. | +| `db.cassandra.idempotence` | boolean | Deprecated, use `cassandra.query.idempotent` instead. | | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `cassandra.query.idempotent`. | +| `db.cassandra.page_size` | int | Deprecated, use `cassandra.page.size` instead. | `5000` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `cassandra.page.size`. | +| `db.cassandra.speculative_execution_count` | int | Deprecated, use `cassandra.speculative_execution.count` instead. | `0`; `2` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `cassandra.speculative_execution.count`. | +| `db.cassandra.table` | string | Deprecated, use `db.collection.name` instead. | `mytable` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.collection.name`. | +| `db.connection_string` | string | Deprecated, use `server.address`, `server.port` attributes instead. | `Server=(localdb)\v11.0;Integrated Security=true;` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `server.address` and `server.port`. | +| `db.cosmosdb.client_id` | string | Deprecated, use `azure.client.id` instead. | `3ba4827d-4422-483f-b59f-85b74211c11d` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `azure.client.id`. | +| `db.cosmosdb.connection_mode` | string | Deprecated, use `azure.cosmosdb.connection.mode` instead. | `gateway`; `direct` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `azure.cosmosdb.connection.mode`. | +| `db.cosmosdb.consistency_level` | string | Deprecated, use `cosmosdb.consistency.level` instead. | `Eventual`; `ConsistentPrefix`; `BoundedStaleness`; `Strong`; `Session` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `azure.cosmosdb.consistency.level`. | +| `db.cosmosdb.container` | string | Deprecated, use `db.collection.name` instead. | `mytable` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.collection.name`. | +| `db.cosmosdb.operation_type` | string | Deprecated, no replacement at this time. | `batch`; `create`; `delete` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Removed, no replacement at this time. | +| `db.cosmosdb.regions_contacted` | string[] | Deprecated, use `azure.cosmosdb.operation.contacted_regions` instead. | `["North Central US", "Australia East", "Australia Southeast"]` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `azure.cosmosdb.operation.contacted_regions`. | +| `db.cosmosdb.request_charge` | double | Deprecated, use `azure.cosmosdb.operation.request_charge` instead. | `46.18`; `1.0` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `azure.cosmosdb.operation.request_charge`. | +| `db.cosmosdb.request_content_length` | int | Deprecated, use `azure.cosmosdb.request.body.size` instead. | | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `azure.cosmosdb.request.body.size`. | +| `db.cosmosdb.status_code` | int | Deprecated, use `db.response.status_code` instead. | `200`; `201` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Uncategorized. | +| `db.cosmosdb.sub_status_code` | int | Deprecated, use `azure.cosmosdb.response.sub_status_code` instead. | `1000`; `1002` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `azure.cosmosdb.response.sub_status_code`. | +| `db.elasticsearch.cluster.name` | string | Deprecated, use `db.namespace` instead. | `e9106fc68e3044f0b1475b04bf4ffd5f` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.namespace`. | +| `db.elasticsearch.node.name` | string | Deprecated, use `elasticsearch.node.name` instead. | `instance-0000000001` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `elasticsearch.node.name`. | +| `db.elasticsearch.path_parts.` | string | Deprecated, use `db.operation.parameter` instead. | `test-index`; `123` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.operation.parameter`. | +| `db.instance.id` | string | Deprecated, no general replacement at this time. For Elasticsearch, use `db.elasticsearch.node.name` instead. | `mysql-e26b99z.example.com` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Removed, no general replacement at this time. For Elasticsearch, use `db.elasticsearch.node.name` instead. | +| `db.jdbc.driver_classname` | string | Removed, no replacement at this time. | `org.postgresql.Driver`; `com.microsoft.sqlserver.jdbc.SQLServerDriver` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Removed, no replacement at this time. | +| `db.mongodb.collection` | string | Deprecated, use `db.collection.name` instead. | `mytable` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.collection.name`. | +| `db.mssql.instance_name` | string | Deprecated, SQL Server instance is now populated as a part of `db.namespace` attribute. | `MSSQLSERVER` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Removed, no replacement at this time. | +| `db.name` | string | Deprecated, use `db.namespace` instead. | `customers`; `main` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.namespace`. | +| `db.operation` | string | Deprecated, use `db.operation.name` instead. | `findAndModify`; `HMSET`; `SELECT` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.operation.name`. | +| `db.redis.database_index` | int | Deprecated, use `db.namespace` instead. | `0`; `1`; `15` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Uncategorized. | +| `db.sql.table` | string | Deprecated, use `db.collection.name` instead. | `mytable` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.collection.name`, but only if not extracting the value from `db.query.text`. | +| `db.statement` | string | The database statement being executed. | `SELECT * FROM wuser_table`; `SET mykey "WuValue"` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.query.text`. | +| `db.system` | string | Deprecated, use `db.system.name` instead. | `other_sql`; `adabas`; `intersystems_cache` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.system.name`. | +| `db.user` | string | Deprecated, no replacement at this time. | `readonly_user`; `reporting_user` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Removed, no replacement at this time. | --- @@ -334,10 +343,10 @@ Describes deprecated db metrics attributes. | Key | Stability | Value Type | Description | Example Values | |---|---|---|---|---| -| `db.client.connections.pool.name` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.client.connection.pool.name`. | string | Deprecated, use `db.client.connection.pool.name` instead. | `myDataSource` | -| `db.client.connections.state` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.client.connection.state`. | string | Deprecated, use `db.client.connection.state` instead. | `idle` | -| `pool.name` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.client.connection.pool.name`. | string | Deprecated, use `db.client.connection.pool.name` instead. | `myDataSource` | -| `state` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.client.connection.state`. | string | Deprecated, use `db.client.connection.state` instead. | `idle` | +| `db.client.connections.pool.name` | string | Deprecated, use `db.client.connection.pool.name` instead. | `myDataSource` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.client.connection.pool.name`. | +| `db.client.connections.state` | string | Deprecated, use `db.client.connection.state` instead. | `idle` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.client.connection.state`. | +| `pool.name` | string | Deprecated, use `db.client.connection.pool.name` instead. | `myDataSource` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.client.connection.pool.name`. | +| `state` | string | Deprecated, use `db.client.connection.state` instead. | `idle` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.client.connection.state`. | --- diff --git a/model/database/registry.yaml b/model/database/registry.yaml index e3da7104c8..d0a27e52b3 100644 --- a/model/database/registry.yaml +++ b/model/database/registry.yaml @@ -175,6 +175,32 @@ groups: stability: development brief: Number of rows returned by the operation. examples: [10, 30, 1000] + - id: db.retrieval.type + type: string + stability: development + brief: The type of retrieval operation being performed. + note: > + This attribute describes the retrieval strategy used by the database or vector store. + Common types include similarity search, hybrid search (combining multiple strategies), + keyword search, or other database-specific retrieval methods. + examples: ["similarity", "hybrid", "keyword", "mmr"] + - id: db.retrieval.top_k + type: int + stability: development + brief: The maximum number of results requested to be retrieved. + note: > + This represents the limit parameter or top_k value specified in the retrieval query, + indicating how many results the client requested. The actual number of results + returned may be captured in `db.retrieval.documents_retrieved`. + examples: [5, 10, 20, 100] + - id: db.retrieval.documents_retrieved + type: int + stability: development + brief: The actual number of documents or results retrieved by the operation. + note: > + This represents the count of documents/results actually returned by the database, + which may be less than `db.retrieval.top_k` if fewer matching results were found. + examples: [5, 10, 15] - id: db.system.name brief: The database management system (DBMS) product as identified by the client instrumentation. note: > diff --git a/model/database/spans.yaml b/model/database/spans.yaml index c99e616fbb..283e6b74bc 100644 --- a/model/database/spans.yaml +++ b/model/database/spans.yaml @@ -1017,3 +1017,61 @@ groups: For batch operations, if the individual operations are known to have the same query text then that query text SHOULD be used, otherwise all of the individual query texts SHOULD be concatenated with separator `; ` or some other database system specific separator if more applicable. examples: ["SELECT * FROM wuser_table where username = :mykey"] + - id: span.db.retrieval.client + type: span + stability: development + extends: trace.db.common.minimal + span_kind: client + brief: > + Spans representing retrieval calls adhere to the general + [Semantic Conventions for Database Client Spans](/docs/database/database-spans.md). + note: | + Retrieval calls can be made to vector databases, search engines, and other systems optimized + for similarity search and retrieval operations. These systems are commonly used in + Retrieval-Augmented Generation (RAG) applications and semantic search. + + `db.system.name` SHOULD be set to the specific database system being used (e.g., `"pinecone"`, + `"weaviate"`, `"qdrant"`, `"chroma"`, `"milvus"`) and SHOULD be provided **at span creation time**. + + **Span name** SHOULD follow the general [database span name convention](/docs/database/database-spans.md#name). + For retrieval operations, the span name SHOULD be `{db.operation.name} {db.collection.name}` when both + are available, or `{db.operation.name}` otherwise. Common operation names include `search`, `query`, + `retrieve`, or database-specific operation names. + + **Span kind** SHOULD be `CLIENT`. It MAY be set to `INTERNAL` on spans representing + in-memory retrieval operations. + attributes: + - ref: db.system.name + sampling_relevant: true + requirement_level: required + note: > + For retrieval databases, this should be set to the specific system name + (e.g., `"pinecone"`, `"weaviate"`, `"qdrant"`, `"chroma"`, `"milvus"`). + - ref: db.retrieval.type + requirement_level: recommended + brief: > + The type of retrieval operation being performed. + examples: ["similarity", "hybrid", "keyword"] + - ref: db.retrieval.top_k + requirement_level: recommended + brief: > + The maximum number of results requested. + examples: [5, 10, 20] + - ref: db.retrieval.documents_retrieved + requirement_level: recommended + brief: > + The actual number of documents retrieved. + examples: [5, 10, 15] + - ref: db.query.text + sampling_relevant: true + requirement_level: + recommended: > + Should be collected when available and after sanitization to exclude sensitive data. + brief: > + The query text or vector representation used for retrieval. + note: > + For vector similarity searches, this may contain the query vector representation + or a textual description of the query. For hybrid searches, it may contain + the keyword query portion. The value should be sanitized to remove sensitive information. + examples: ["[0.1, 0.2, 0.3, ...]", "search term", "semantic query text"] + diff --git a/model/gen-ai/registry.yaml b/model/gen-ai/registry.yaml index 5752b3efc6..8b3fa51dd4 100644 --- a/model/gen-ai/registry.yaml +++ b/model/gen-ai/registry.yaml @@ -382,10 +382,6 @@ groups: value: "execute_tool" brief: 'Execute a tool' stability: development - - id: retrieval - value: "retrieval" - brief: 'Retrieval operation such as [OpenAI Retrieval API](https://platform.openai.com/docs/guides/retrieval)' - stability: development brief: The name of the operation being performed. note: > If one of the predefined values applies, but specific system uses a different name it's RECOMMENDED to document it in the semantic @@ -430,26 +426,6 @@ groups: type: int brief: The number of dimensions the resulting output embeddings should have. examples: [512, 1024] - - id: gen_ai.retrieval.type - stability: development - type: string - brief: The type of retrieval being performed. - examples: ["similarity", "hybrid"] - - id: gen_ai.retrieval.vector_store - stability: development - type: string - brief: The vector store being used for retrieval. - examples: ["faiss", "pinecone"] - - id: gen_ai.retrieval.top_k - stability: development - type: int - brief: The number of documents to retrieve. - examples: [5, 10] - - id: gen_ai.retrieval.documents_retrieved - stability: development - type: int - brief: The number of documents retrieved. - examples: [5, 10] - id: gen_ai.system_instructions stability: development type: any diff --git a/model/gen-ai/spans.yaml b/model/gen-ai/spans.yaml index 91af3a1bc9..3ac2d84648 100644 --- a/model/gen-ai/spans.yaml +++ b/model/gen-ai/spans.yaml @@ -217,28 +217,6 @@ groups: - ref: gen_ai.embeddings.dimension.count requirement_level: recommended - - id: span.gen_ai.retrieval.client - type: span - span_kind: client - stability: development - brief: > - Describes GenAI Retrieval Span - where relevant information or context is stored - in a vector database or search system to be passed to a language model at a later time. - - The `gen_ai.operation.name` SHOULD be `retrieval`. - - **Span name** SHOULD be `{gen_ai.operation.name} {gen_ai.request.model}`. - extends: attributes.gen_ai.common.client - attributes: - - ref: gen_ai.retrieval.type - requirement_level: recommended - - ref: gen_ai.retrieval.vector_store - requirement_level: recommended - - ref: gen_ai.retrieval.top_k - requirement_level: recommended - - ref: gen_ai.retrieval.documents_retrieved - requirement_level: recommended - - id: span.gen_ai.create_agent.client type: span stability: development From bf22f305ea089c4df54f45036a17d0c674a9f33a Mon Sep 17 00:00:00 2001 From: JWinermaSplunk Date: Fri, 21 Nov 2025 12:09:56 -0800 Subject: [PATCH 3/4] update change log for db --- .chloggen/retrieval-span-support.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.chloggen/retrieval-span-support.yaml b/.chloggen/retrieval-span-support.yaml index dcd378d9cf..4cd7e188dc 100644 --- a/.chloggen/retrieval-span-support.yaml +++ b/.chloggen/retrieval-span-support.yaml @@ -7,10 +7,10 @@ change_type: 'new_component' # The name of the area of concern in the attributes-registry, (e.g. http, cloud, db) -component: gen-ai +component: db # A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). -note: Add retrieval span support to the gen-ai-spans semantic conventions. +note: Add retrieval span support to the db semantic conventions. # Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. # The values here must be integers. From 3b69cd5184ebea4366a47e4f94274604977f57b1 Mon Sep 17 00:00:00 2001 From: JWinermaSplunk Date: Fri, 21 Nov 2025 12:29:41 -0800 Subject: [PATCH 4/4] updates --- docs/database/retrieval.md | 44 +++++++------- docs/gen-ai/gen-ai-spans.md | 68 --------------------- docs/registry/attributes/db.md | 108 ++++++++++++++++----------------- 3 files changed, 77 insertions(+), 143 deletions(-) diff --git a/docs/database/retrieval.md b/docs/database/retrieval.md index 98d7db8b5d..6072ef3cad 100644 --- a/docs/database/retrieval.md +++ b/docs/database/retrieval.md @@ -32,23 +32,27 @@ in-memory retrieval operations. **Span status** SHOULD follow the [Recording Errors](/docs/general/recording-errors.md) document. -| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | +**Attributes:** + +| Key | Stability | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Value Type | Description | Example Values | |---|---|---|---|---|---| -| [`db.system.name`](/docs/registry/attributes/db.md) | string | The database management system (DBMS) product as identified by the client instrumentation. [1] | `other_sql`; `softwareag.adabas`; `actian.ingres` | `Required` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | -| [`db.operation.name`](/docs/registry/attributes/db.md) | string | The name of the operation or command being executed. [2] | `findAndModify`; `HMSET`; `SELECT` | `Conditionally Required` [3] | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | -| [`db.response.status_code`](/docs/registry/attributes/db.md) | string | Database response status code. [4] | `102`; `ORA-17002`; `08P01`; `404` | `Conditionally Required` [5] | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | -| [`error.type`](/docs/registry/attributes/error.md) | string | Describes a class of error the operation ended with. [6] | `timeout`; `java.net.UnknownHostException`; `server_certificate_invalid`; `500` | `Conditionally Required` If and only if the operation failed. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | -| [`server.port`](/docs/registry/attributes/server.md) | int | Server port number. [7] | `80`; `8080`; `443` | `Conditionally Required` [8] | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | -| [`db.operation.batch.size`](/docs/registry/attributes/db.md) | int | The number of queries included in a batch operation. [9] | `2`; `3`; `4` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | -| [`db.query.text`](/docs/registry/attributes/db.md) | string | The query text or vector representation used for retrieval. [10] | `[0.1, 0.2, 0.3, ...]`; `search term`; `semantic query text` | `Recommended` [11] | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | -| [`db.retrieval.documents_retrieved`](/docs/registry/attributes/db.md) | int | The actual number of documents retrieved. [12] | `5`; `10`; `15` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) | -| [`db.retrieval.top_k`](/docs/registry/attributes/db.md) | int | The maximum number of results requested. [13] | `5`; `10`; `20` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) | -| [`db.retrieval.type`](/docs/registry/attributes/db.md) | string | The type of retrieval operation being performed. [14] | `similarity`; `hybrid`; `keyword` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) | -| [`server.address`](/docs/registry/attributes/server.md) | string | Name of the database host. [15] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`db.system.name`](/docs/registry/attributes/db.md) | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | `Required` | string | The database management system (DBMS) product as identified by the client instrumentation. [1] | `other_sql`; `softwareag.adabas`; `actian.ingres` | +| [`db.operation.name`](/docs/registry/attributes/db.md) | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | `Conditionally Required` [2] | string | The name of the operation or command being executed. [3] | `findAndModify`; `HMSET`; `SELECT` | +| [`db.response.status_code`](/docs/registry/attributes/db.md) | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | `Conditionally Required` [4] | string | Database response status code. [5] | `102`; `ORA-17002`; `08P01`; `404` | +| [`error.type`](/docs/registry/attributes/error.md) | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | `Conditionally Required` If and only if the operation failed. | string | Describes a class of error the operation ended with. [6] | `timeout`; `java.net.UnknownHostException`; `server_certificate_invalid`; `500` | +| [`server.port`](/docs/registry/attributes/server.md) | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | `Conditionally Required` [7] | int | Server port number. [8] | `80`; `8080`; `443` | +| [`db.operation.batch.size`](/docs/registry/attributes/db.md) | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | `Recommended` | int | The number of queries included in a batch operation. [9] | `2`; `3`; `4` | +| [`db.query.text`](/docs/registry/attributes/db.md) | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | `Recommended` [10] | string | The query text or vector representation used for retrieval. [11] | `[0.1, 0.2, 0.3, ...]`; `search term`; `semantic query text` | +| [`db.retrieval.documents_retrieved`](/docs/registry/attributes/db.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | int | The actual number of documents retrieved. [12] | `5`; `10`; `15` | +| [`db.retrieval.top_k`](/docs/registry/attributes/db.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | int | The maximum number of results requested. [13] | `5`; `10`; `20` | +| [`db.retrieval.type`](/docs/registry/attributes/db.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | string | The type of retrieval operation being performed. [14] | `similarity`; `hybrid`; `keyword` | +| [`server.address`](/docs/registry/attributes/server.md) | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | `Recommended` | string | Name of the database host. [15] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | **[1] `db.system.name`:** For retrieval databases, this should be set to the specific system name (e.g., `"pinecone"`, `"weaviate"`, `"qdrant"`, `"chroma"`, `"milvus"`). -**[2] `db.operation.name`:** It is RECOMMENDED to capture the value as provided by the application +**[2] `db.operation.name`:** If readily available and if there is a single operation name that describes the database call. + +**[3] `db.operation.name`:** It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization. The operation name SHOULD NOT be extracted from `db.query.text`, @@ -63,26 +67,24 @@ then that operation name SHOULD be used prepended by `BATCH `, otherwise `db.operation.name` SHOULD be `BATCH` or some other database system specific term if more applicable. -**[3] `db.operation.name`:** If readily available and if there is a single operation name that describes the database call. +**[4] `db.response.status_code`:** If the operation failed and status code is available. -**[4] `db.response.status_code`:** The status code returned by the database. Usually it represents an error code, but may also represent partial success, warning, or differentiate between various types of successful outcomes. +**[5] `db.response.status_code`:** The status code returned by the database. Usually it represents an error code, but may also represent partial success, warning, or differentiate between various types of successful outcomes. Semantic conventions for individual database systems SHOULD document what `db.response.status_code` means in the context of that system. -**[5] `db.response.status_code`:** If the operation failed and status code is available. - **[6] `error.type`:** The `error.type` SHOULD match the `db.response.status_code` returned by the database or the client library, or the canonical name of exception that occurred. When using canonical exception type name, instrumentation SHOULD do the best effort to report the most relevant type. For example, if the original exception is wrapped into a generic one, the original exception SHOULD be preferred. Instrumentations SHOULD document how `error.type` is populated. -**[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. +**[7] `server.port`:** If using a port other than the default port for this DBMS and if `server.address` is set. -**[8] `server.port`:** If using a port other than the default port for this DBMS and if `server.address` is set. +**[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. **[9] `db.operation.batch.size`:** Operations are only considered batches when they contain two or more operations, and so `db.operation.batch.size` SHOULD never be `1`. -**[10] `db.query.text`:** For vector similarity searches, this may contain the query vector representation or a textual description of the query. For hybrid searches, it may contain the keyword query portion. The value should be sanitized to remove sensitive information. +**[10] `db.query.text`:** Should be collected when available and after sanitization to exclude sensitive data. -**[11] `db.query.text`:** Should be collected when available and after sanitization to exclude sensitive data. +**[11] `db.query.text`:** For vector similarity searches, this may contain the query vector representation or a textual description of the query. For hybrid searches, it may contain the keyword query portion. The value should be sanitized to remove sensitive information. **[12] `db.retrieval.documents_retrieved`:** This represents the count of documents/results actually returned by the database, which may be less than `db.retrieval.top_k` if fewer matching results were found. diff --git a/docs/gen-ai/gen-ai-spans.md b/docs/gen-ai/gen-ai-spans.md index e606735587..7f4ab2e975 100644 --- a/docs/gen-ai/gen-ai-spans.md +++ b/docs/gen-ai/gen-ai-spans.md @@ -11,7 +11,6 @@ linkTitle: Spans - [Spans](#spans) - [Inference](#inference) - [Embeddings](#embeddings) - - [Retrievals](#retrievals) - [Execute tool span](#execute-tool-span) - [Capturing instructions, inputs, and outputs](#capturing-instructions-inputs-and-outputs) - [Full (buffered) content](#full-buffered-content) @@ -357,73 +356,6 @@ Instrumentations SHOULD document the list of errors they report. - - - - - - -**Status:** ![Development](https://img.shields.io/badge/-development-blue) - -Describes GenAI Retrieval Span - where relevant information or context is stored in a vector database or search system to be passed to a language model at a later time. -The `gen_ai.operation.name` SHOULD be `retrieval`. -**Span name** SHOULD be `{gen_ai.operation.name} {gen_ai.request.model}`. - -**Span kind** SHOULD be `CLIENT`. - -**Span status** SHOULD follow the [Recording Errors](/docs/general/recording-errors.md) document. - -| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | -|---|---|---|---|---|---| -| [`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) | -| [`error.type`](/docs/registry/attributes/error.md) | string | Describes a class of error the operation ended with. [2] | `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) | -| [`gen_ai.request.model`](/docs/registry/attributes/gen-ai.md) | string | The name of the GenAI model a request is being made to. [3] | `gpt-4` | `Conditionally Required` If available. | ![Development](https://img.shields.io/badge/-development-blue) | -| [`server.port`](/docs/registry/attributes/server.md) | int | GenAI server port. [4] | `80`; `8080`; `443` | `Conditionally Required` If `server.address` is set. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | -| [`gen_ai.retrieval.documents_retrieved`](/docs/registry/attributes/gen-ai.md) | int | The number of documents retrieved. | `5`; `10` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) | -| [`gen_ai.retrieval.top_k`](/docs/registry/attributes/gen-ai.md) | int | The number of documents to retrieve. | `5`; `10` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) | -| [`gen_ai.retrieval.type`](/docs/registry/attributes/gen-ai.md) | string | The type of retrieval being performed. | `similarity`; `hybrid` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) | -| [`gen_ai.retrieval.vector_store`](/docs/registry/attributes/gen-ai.md) | string | The vector store being used for retrieval. | `faiss`; `pinecone` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) | -| [`server.address`](/docs/registry/attributes/server.md) | string | GenAI server address. [5] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - -**[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. - -**[2] `error.type`:** The `error.type` SHOULD match the error code returned by the Generative AI provider or the client library, -the canonical name of exception that occurred, or another low-cardinality error identifier. -Instrumentations SHOULD document the list of errors they report. - -**[3] `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. - -**[4] `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. - -**[5] `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. - ---- - -`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. - -| Value | Description | Stability | -|---|---|---| -| `_OTHER` | A fallback error value to be used when the instrumentation doesn't define a custom value. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | - ---- - -`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. - -| Value | Description | Stability | -|---|---|---| -| `chat` | Chat completion operation such as [OpenAI Chat API](https://platform.openai.com/docs/api-reference/chat) | ![Development](https://img.shields.io/badge/-development-blue) | -| `create_agent` | Create GenAI agent | ![Development](https://img.shields.io/badge/-development-blue) | -| `embeddings` | Embeddings operation such as [OpenAI Create embeddings API](https://platform.openai.com/docs/api-reference/embeddings/create) | ![Development](https://img.shields.io/badge/-development-blue) | -| `execute_tool` | Execute a tool | ![Development](https://img.shields.io/badge/-development-blue) | -| `generate_content` | Multimodal content generation operation such as [Gemini Generate Content](https://ai.google.dev/api/generate-content) | ![Development](https://img.shields.io/badge/-development-blue) | -| `invoke_agent` | Invoke GenAI agent | ![Development](https://img.shields.io/badge/-development-blue) | -| `retrieval` | Retrieval operation such as [OpenAI Retrieval API](https://platform.openai.com/docs/guides/retrieval) | ![Development](https://img.shields.io/badge/-development-blue) | -| `text_completion` | Text completions operation such as [OpenAI Completions API (Legacy)](https://platform.openai.com/docs/api-reference/completions) | ![Development](https://img.shields.io/badge/-development-blue) | - - - - - ### Execute tool span diff --git a/docs/registry/attributes/db.md b/docs/registry/attributes/db.md index 9829e9b7a5..884a7c515c 100644 --- a/docs/registry/attributes/db.md +++ b/docs/registry/attributes/db.md @@ -15,23 +15,23 @@ This group defines the attributes used to describe telemetry in the context of d | Key | Stability | Value Type | Description | Example Values | |---|---|---|---|---| -| `db.client.connection.pool.name` | string | The name of the connection pool; unique within the instrumented application. In case the connection pool implementation doesn't provide a name, instrumentation SHOULD use a combination of parameters that would make the name unique, for example, combining attributes `server.address`, `server.port`, and `db.namespace`, formatted as `server.address:server.port/db.namespace`. Instrumentations that generate connection pool name following different patterns SHOULD document it. | `myDataSource` | ![Development](https://img.shields.io/badge/-development-blue) | -| `db.client.connection.state` | string | The state of a connection in the pool | `idle` | ![Development](https://img.shields.io/badge/-development-blue) | -| `db.collection.name` | string | The name of a collection (table, container) within the database. [1] | `public.users`; `customers` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | -| `db.namespace` | string | The name of the database, fully qualified within the server address and port. [2] | `customers`; `test.users` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | -| `db.operation.batch.size` | int | The number of queries included in a batch operation. [3] | `2`; `3`; `4` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | -| `db.operation.name` | string | The name of the operation or command being executed. [4] | `findAndModify`; `HMSET`; `SELECT` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | -| `db.operation.parameter.` | string | A database operation parameter, with `` being the parameter name, and the attribute value being a string representation of the parameter value. [5] | `someval`; `55` | ![Development](https://img.shields.io/badge/-development-blue) | -| `db.query.parameter.` | string | A database query parameter, with `` being the parameter name, and the attribute value being a string representation of the parameter value. [6] | `someval`; `55` | ![Development](https://img.shields.io/badge/-development-blue) | -| `db.query.summary` | string | Low cardinality summary of a database query. [7] | `SELECT wuser_table`; `INSERT shipping_details SELECT orders`; `get user by id` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | -| `db.query.text` | string | The database query being executed. [8] | `SELECT * FROM wuser_table where username = ?`; `SET mykey ?` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | -| `db.response.returned_rows` | int | Number of rows returned by the operation. | `10`; `30`; `1000` | ![Development](https://img.shields.io/badge/-development-blue) | -| `db.response.status_code` | string | Database response status code. [9] | `102`; `ORA-17002`; `08P01`; `404` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | -| `db.retrieval.documents_retrieved` | int | The actual number of documents or results retrieved by the operation. [10] | `5`; `10`; `15` | ![Development](https://img.shields.io/badge/-development-blue) | -| `db.retrieval.top_k` | int | The maximum number of results requested to be retrieved. [11] | `5`; `10`; `20`; `100` | ![Development](https://img.shields.io/badge/-development-blue) | -| `db.retrieval.type` | string | The type of retrieval operation being performed. [12] | `similarity`; `hybrid`; `keyword`; `mmr` | ![Development](https://img.shields.io/badge/-development-blue) | -| `db.stored_procedure.name` | string | The name of a stored procedure within the database. [13] | `GetCustomer` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | -| `db.system.name` | string | The database management system (DBMS) product as identified by the client instrumentation. [14] | `other_sql`; `softwareag.adabas`; `actian.ingres` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| `db.client.connection.pool.name` | ![Development](https://img.shields.io/badge/-development-blue) | string | The name of the connection pool; unique within the instrumented application. In case the connection pool implementation doesn't provide a name, instrumentation SHOULD use a combination of parameters that would make the name unique, for example, combining attributes `server.address`, `server.port`, and `db.namespace`, formatted as `server.address:server.port/db.namespace`. Instrumentations that generate connection pool name following different patterns SHOULD document it. | `myDataSource` | +| `db.client.connection.state` | ![Development](https://img.shields.io/badge/-development-blue) | string | The state of a connection in the pool | `idle` | +| `db.collection.name` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | string | The name of a collection (table, container) within the database. [1] | `public.users`; `customers` | +| `db.namespace` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | string | The name of the database, fully qualified within the server address and port. [2] | `customers`; `test.users` | +| `db.operation.batch.size` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | int | The number of queries included in a batch operation. [3] | `2`; `3`; `4` | +| `db.operation.name` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | string | The name of the operation or command being executed. [4] | `findAndModify`; `HMSET`; `SELECT` | +| `db.operation.parameter.` | ![Development](https://img.shields.io/badge/-development-blue) | string | A database operation parameter, with `` being the parameter name, and the attribute value being a string representation of the parameter value. [5] | `someval`; `55` | +| `db.query.parameter.` | ![Development](https://img.shields.io/badge/-development-blue) | string | A database query parameter, with `` being the parameter name, and the attribute value being a string representation of the parameter value. [6] | `someval`; `55` | +| `db.query.summary` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | string | Low cardinality summary of a database query. [7] | `SELECT wuser_table`; `INSERT shipping_details SELECT orders`; `get user by id` | +| `db.query.text` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | string | The database query being executed. [8] | `SELECT * FROM wuser_table where username = ?`; `SET mykey ?` | +| `db.response.returned_rows` | ![Development](https://img.shields.io/badge/-development-blue) | int | Number of rows returned by the operation. | `10`; `30`; `1000` | +| `db.response.status_code` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | string | Database response status code. [9] | `102`; `ORA-17002`; `08P01`; `404` | +| `db.retrieval.documents_retrieved` | ![Development](https://img.shields.io/badge/-development-blue) | int | The actual number of documents or results retrieved by the operation. [10] | `5`; `10`; `15` | +| `db.retrieval.top_k` | ![Development](https://img.shields.io/badge/-development-blue) | int | The maximum number of results requested to be retrieved. [11] | `5`; `10`; `20`; `100` | +| `db.retrieval.type` | ![Development](https://img.shields.io/badge/-development-blue) | string | The type of retrieval operation being performed. [12] | `similarity`; `hybrid`; `keyword`; `mmr` | +| `db.stored_procedure.name` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | string | The name of a stored procedure within the database. [13] | `GetCustomer` | +| `db.system.name` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | string | The database management system (DBMS) product as identified by the client instrumentation. [14] | `other_sql`; `softwareag.adabas`; `actian.ingres` | **[1] `db.collection.name`:** It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization. @@ -118,7 +118,7 @@ without attempting to do any case normalization. For batch operations, if the individual operations are known to have the same stored procedure name then that stored procedure name SHOULD be used. -**[11] `db.system.name`:** The actual DBMS may differ from the one identified by the client. For example, when using PostgreSQL client libraries to connect to a CockroachDB, the `db.system.name` is set to `postgresql` based on the instrumentation's best knowledge. +**[14] `db.system.name`:** The actual DBMS may differ from the one identified by the client. For example, when using PostgreSQL client libraries to connect to a CockroachDB, the `db.system.name` is set to `postgresql` based on the instrumentation's best knowledge. --- @@ -185,38 +185,38 @@ Describes deprecated database attributes. | Key | Stability | Value Type | Description | Example Values | |---|---|---|---|---| -| `db.cassandra.consistency_level` | string | Deprecated, use `cassandra.consistency.level` instead. | `all`; `each_quorum`; `quorum` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `cassandra.consistency.level`. | -| `db.cassandra.coordinator.dc` | string | Deprecated, use `cassandra.coordinator.dc` instead. | `us-west-2` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `cassandra.coordinator.dc`. | -| `db.cassandra.coordinator.id` | string | Deprecated, use `cassandra.coordinator.id` instead. | `be13faa2-8574-4d71-926d-27f16cf8a7af` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `cassandra.coordinator.id`. | -| `db.cassandra.idempotence` | boolean | Deprecated, use `cassandra.query.idempotent` instead. | | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `cassandra.query.idempotent`. | -| `db.cassandra.page_size` | int | Deprecated, use `cassandra.page.size` instead. | `5000` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `cassandra.page.size`. | -| `db.cassandra.speculative_execution_count` | int | Deprecated, use `cassandra.speculative_execution.count` instead. | `0`; `2` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `cassandra.speculative_execution.count`. | -| `db.cassandra.table` | string | Deprecated, use `db.collection.name` instead. | `mytable` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.collection.name`. | -| `db.connection_string` | string | Deprecated, use `server.address`, `server.port` attributes instead. | `Server=(localdb)\v11.0;Integrated Security=true;` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `server.address` and `server.port`. | -| `db.cosmosdb.client_id` | string | Deprecated, use `azure.client.id` instead. | `3ba4827d-4422-483f-b59f-85b74211c11d` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `azure.client.id`. | -| `db.cosmosdb.connection_mode` | string | Deprecated, use `azure.cosmosdb.connection.mode` instead. | `gateway`; `direct` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `azure.cosmosdb.connection.mode`. | -| `db.cosmosdb.consistency_level` | string | Deprecated, use `cosmosdb.consistency.level` instead. | `Eventual`; `ConsistentPrefix`; `BoundedStaleness`; `Strong`; `Session` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `azure.cosmosdb.consistency.level`. | -| `db.cosmosdb.container` | string | Deprecated, use `db.collection.name` instead. | `mytable` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.collection.name`. | -| `db.cosmosdb.operation_type` | string | Deprecated, no replacement at this time. | `batch`; `create`; `delete` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Removed, no replacement at this time. | -| `db.cosmosdb.regions_contacted` | string[] | Deprecated, use `azure.cosmosdb.operation.contacted_regions` instead. | `["North Central US", "Australia East", "Australia Southeast"]` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `azure.cosmosdb.operation.contacted_regions`. | -| `db.cosmosdb.request_charge` | double | Deprecated, use `azure.cosmosdb.operation.request_charge` instead. | `46.18`; `1.0` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `azure.cosmosdb.operation.request_charge`. | -| `db.cosmosdb.request_content_length` | int | Deprecated, use `azure.cosmosdb.request.body.size` instead. | | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `azure.cosmosdb.request.body.size`. | -| `db.cosmosdb.status_code` | int | Deprecated, use `db.response.status_code` instead. | `200`; `201` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Uncategorized. | -| `db.cosmosdb.sub_status_code` | int | Deprecated, use `azure.cosmosdb.response.sub_status_code` instead. | `1000`; `1002` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `azure.cosmosdb.response.sub_status_code`. | -| `db.elasticsearch.cluster.name` | string | Deprecated, use `db.namespace` instead. | `e9106fc68e3044f0b1475b04bf4ffd5f` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.namespace`. | -| `db.elasticsearch.node.name` | string | Deprecated, use `elasticsearch.node.name` instead. | `instance-0000000001` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `elasticsearch.node.name`. | -| `db.elasticsearch.path_parts.` | string | Deprecated, use `db.operation.parameter` instead. | `test-index`; `123` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.operation.parameter`. | -| `db.instance.id` | string | Deprecated, no general replacement at this time. For Elasticsearch, use `db.elasticsearch.node.name` instead. | `mysql-e26b99z.example.com` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Removed, no general replacement at this time. For Elasticsearch, use `db.elasticsearch.node.name` instead. | -| `db.jdbc.driver_classname` | string | Removed, no replacement at this time. | `org.postgresql.Driver`; `com.microsoft.sqlserver.jdbc.SQLServerDriver` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Removed, no replacement at this time. | -| `db.mongodb.collection` | string | Deprecated, use `db.collection.name` instead. | `mytable` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.collection.name`. | -| `db.mssql.instance_name` | string | Deprecated, SQL Server instance is now populated as a part of `db.namespace` attribute. | `MSSQLSERVER` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Removed, no replacement at this time. | -| `db.name` | string | Deprecated, use `db.namespace` instead. | `customers`; `main` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.namespace`. | -| `db.operation` | string | Deprecated, use `db.operation.name` instead. | `findAndModify`; `HMSET`; `SELECT` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.operation.name`. | -| `db.redis.database_index` | int | Deprecated, use `db.namespace` instead. | `0`; `1`; `15` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Uncategorized. | -| `db.sql.table` | string | Deprecated, use `db.collection.name` instead. | `mytable` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.collection.name`, but only if not extracting the value from `db.query.text`. | -| `db.statement` | string | The database statement being executed. | `SELECT * FROM wuser_table`; `SET mykey "WuValue"` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.query.text`. | -| `db.system` | string | Deprecated, use `db.system.name` instead. | `other_sql`; `adabas`; `intersystems_cache` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.system.name`. | -| `db.user` | string | Deprecated, no replacement at this time. | `readonly_user`; `reporting_user` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Removed, no replacement at this time. | +| `db.cassandra.consistency_level` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `cassandra.consistency.level`. | string | Deprecated, use `cassandra.consistency.level` instead. | `all`; `each_quorum`; `quorum` | +| `db.cassandra.coordinator.dc` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `cassandra.coordinator.dc`. | string | Deprecated, use `cassandra.coordinator.dc` instead. | `us-west-2` | +| `db.cassandra.coordinator.id` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `cassandra.coordinator.id`. | string | Deprecated, use `cassandra.coordinator.id` instead. | `be13faa2-8574-4d71-926d-27f16cf8a7af` | +| `db.cassandra.idempotence` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `cassandra.query.idempotent`. | boolean | Deprecated, use `cassandra.query.idempotent` instead. | | +| `db.cassandra.page_size` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `cassandra.page.size`. | int | Deprecated, use `cassandra.page.size` instead. | `5000` | +| `db.cassandra.speculative_execution_count` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `cassandra.speculative_execution.count`. | int | Deprecated, use `cassandra.speculative_execution.count` instead. | `0`; `2` | +| `db.cassandra.table` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.collection.name`. | string | Deprecated, use `db.collection.name` instead. | `mytable` | +| `db.connection_string` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `server.address` and `server.port`. | string | Deprecated, use `server.address`, `server.port` attributes instead. | `Server=(localdb)\v11.0;Integrated Security=true;` | +| `db.cosmosdb.client_id` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `azure.client.id`. | string | Deprecated, use `azure.client.id` instead. | `3ba4827d-4422-483f-b59f-85b74211c11d` | +| `db.cosmosdb.connection_mode` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `azure.cosmosdb.connection.mode`. | string | Deprecated, use `azure.cosmosdb.connection.mode` instead. | `gateway`; `direct` | +| `db.cosmosdb.consistency_level` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `azure.cosmosdb.consistency.level`. | string | Deprecated, use `cosmosdb.consistency.level` instead. | `Eventual`; `ConsistentPrefix`; `BoundedStaleness`; `Strong`; `Session` | +| `db.cosmosdb.container` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.collection.name`. | string | Deprecated, use `db.collection.name` instead. | `mytable` | +| `db.cosmosdb.operation_type` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Removed, no replacement at this time. | string | Deprecated, no replacement at this time. | `batch`; `create`; `delete` | +| `db.cosmosdb.regions_contacted` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `azure.cosmosdb.operation.contacted_regions`. | string[] | Deprecated, use `azure.cosmosdb.operation.contacted_regions` instead. | `["North Central US", "Australia East", "Australia Southeast"]` | +| `db.cosmosdb.request_charge` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `azure.cosmosdb.operation.request_charge`. | double | Deprecated, use `azure.cosmosdb.operation.request_charge` instead. | `46.18`; `1.0` | +| `db.cosmosdb.request_content_length` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `azure.cosmosdb.request.body.size`. | int | Deprecated, use `azure.cosmosdb.request.body.size` instead. | | +| `db.cosmosdb.status_code` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Use `db.response.status_code` instead. | int | Deprecated, use `db.response.status_code` instead. | `200`; `201` | +| `db.cosmosdb.sub_status_code` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `azure.cosmosdb.response.sub_status_code`. | int | Deprecated, use `azure.cosmosdb.response.sub_status_code` instead. | `1000`; `1002` | +| `db.elasticsearch.cluster.name` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.namespace`. | string | Deprecated, use `db.namespace` instead. | `e9106fc68e3044f0b1475b04bf4ffd5f` | +| `db.elasticsearch.node.name` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `elasticsearch.node.name`. | string | Deprecated, use `elasticsearch.node.name` instead. | `instance-0000000001` | +| `db.elasticsearch.path_parts.` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.operation.parameter`. | string | Deprecated, use `db.operation.parameter` instead. | `test-index`; `123` | +| `db.instance.id` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Removed, no general replacement at this time. For Elasticsearch, use `db.elasticsearch.node.name` instead. | string | Deprecated, no general replacement at this time. For Elasticsearch, use `db.elasticsearch.node.name` instead. | `mysql-e26b99z.example.com` | +| `db.jdbc.driver_classname` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Removed, no replacement at this time. | string | Removed, no replacement at this time. | `org.postgresql.Driver`; `com.microsoft.sqlserver.jdbc.SQLServerDriver` | +| `db.mongodb.collection` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.collection.name`. | string | Deprecated, use `db.collection.name` instead. | `mytable` | +| `db.mssql.instance_name` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Removed, no replacement at this time. | string | Deprecated, SQL Server instance is now populated as a part of `db.namespace` attribute. | `MSSQLSERVER` | +| `db.name` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.namespace`. | string | Deprecated, use `db.namespace` instead. | `customers`; `main` | +| `db.operation` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.operation.name`. | string | Deprecated, use `db.operation.name` instead. | `findAndModify`; `HMSET`; `SELECT` | +| `db.redis.database_index` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Uncategorized. | int | Deprecated, use `db.namespace` instead. | `0`; `1`; `15` | +| `db.sql.table` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.collection.name`, but only if not extracting the value from `db.query.text`. | string | Deprecated, use `db.collection.name` instead. | `mytable` | +| `db.statement` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.query.text`. | string | The database statement being executed. | `SELECT * FROM wuser_table`; `SET mykey "WuValue"` | +| `db.system` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.system.name`. | string | Deprecated, use `db.system.name` instead. | `other_sql`; `adabas`; `intersystems_cache` | +| `db.user` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Removed, no replacement at this time. | string | Deprecated, no replacement at this time. | `readonly_user`; `reporting_user` | --- @@ -343,10 +343,10 @@ Describes deprecated db metrics attributes. | Key | Stability | Value Type | Description | Example Values | |---|---|---|---|---| -| `db.client.connections.pool.name` | string | Deprecated, use `db.client.connection.pool.name` instead. | `myDataSource` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.client.connection.pool.name`. | -| `db.client.connections.state` | string | Deprecated, use `db.client.connection.state` instead. | `idle` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.client.connection.state`. | -| `pool.name` | string | Deprecated, use `db.client.connection.pool.name` instead. | `myDataSource` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.client.connection.pool.name`. | -| `state` | string | Deprecated, use `db.client.connection.state` instead. | `idle` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.client.connection.state`. | +| `db.client.connections.pool.name` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.client.connection.pool.name`. | string | Deprecated, use `db.client.connection.pool.name` instead. | `myDataSource` | +| `db.client.connections.state` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.client.connection.state`. | string | Deprecated, use `db.client.connection.state` instead. | `idle` | +| `pool.name` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.client.connection.pool.name`. | string | Deprecated, use `db.client.connection.pool.name` instead. | `myDataSource` | +| `state` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `db.client.connection.state`. | string | Deprecated, use `db.client.connection.state` instead. | `idle` | ---