diff --git a/.chloggen/1655.yaml b/.chloggen/1655.yaml new file mode 100644 index 0000000000..d15da0a393 --- /dev/null +++ b/.chloggen/1655.yaml @@ -0,0 +1,24 @@ +# 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: enhancement + +# The name of the area of concern in the attributes-registry, (e.g. http, cloud, db) +component: genai + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: | + Adds OpenAI API compatible `gen_ai.system` attribute values: `az.ai.openai`, `deepseek`, `gemini`, `groq`, + `perplexity` and `xai`. Elaborates that `openai` can be ambiguous due to API emulation. + +# 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: [1655] + +# (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/.chloggen/1715.yaml b/.chloggen/1715.yaml new file mode 100644 index 0000000000..677bad9615 --- /dev/null +++ b/.chloggen/1715.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: breaking + +# 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: Rename `gen_ai.openai.request.seed` to `gen_ai.request.seed` and use it on general GenAI 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: [1715] + +# (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/.chloggen/code-rename.yaml b/.chloggen/code-rename.yaml new file mode 100644 index 0000000000..a6192f3d12 --- /dev/null +++ b/.chloggen/code-rename.yaml @@ -0,0 +1,26 @@ +# 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: breaking + +# The name of the area of concern in the attributes-registry, (e.g. http, cloud, db) +component: code + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: rename `code.function`, `code.lineno`, `code.column` and `code.filepath` + +# 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: [ 1377, 1599 ] + +# (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: | + `code.function` renamed to `code.function.name` + `code.lineno` renamed to `code.line.number` + `code.column` renamed to `code.column.number` + `code.filepath` renamed to `code.file.path` diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index 95d54da7bb..9ca83772a1 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -75,9 +75,7 @@ jobs: || { echo "New ./.chloggen/*.yaml file failed validation."; exit 1; } # In order to validate any links in the yaml file, render the config to markdown - - name: Render .chloggen changelog entries + - name: Run markdown-link-check on the changelog run: | - make chlog-preview 2> changelog_preview.md - cat changelog_preview.md - - name: Run markdown-link-check - run: make markdown-link-check-changelog-preview + make chlog-preview &> changelog_preview.md + make markdown-link-check-changelog-preview diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 024f8309b2..ec8ff06763 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -18,7 +18,7 @@ jobs: run: make check-file-and-folder-names-in-docs - name: run markdownlint - run: npx gulp lint-md + run: make markdownlint yamllint: runs-on: ubuntu-latest diff --git a/.lychee.toml b/.lychee.toml new file mode 100644 index 0000000000..38599eea36 --- /dev/null +++ b/.lychee.toml @@ -0,0 +1,16 @@ +include_fragments = true + +accept = ["200..=299", "403"] + +exclude = [ + "^https://www.foo.bar", + # excluding links to pull requests and issues is done for performance + "^https://github.com/open-telemetry/semantic-conventions/(pull|issues)/\\d+$", + "^https://github.com/open-telemetry/opentelemetry-specification/(pull|issues)/\\d+$" +] + +# better to be safe and avoid failures +max_retries = 6 + +# insecure is currently needed for https://osi-model.com +insecure = true diff --git a/.markdown_link_check_config.json b/.markdown_link_check_config.json deleted file mode 100644 index 980cc95414..0000000000 --- a/.markdown_link_check_config.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "ignorePatterns": [ - { - "pattern": "^https://github\\.com/open-telemetry/opentelemetry-specification/(issues|pull)" - }, - { - "pattern": "^https://github\\.com/open-telemetry/semantic-conventions/(issues|pull|actions)" - }, - { - "pattern": "^https://blogs.oracle.com/linux/post/understanding-linux-kernel-memory-statistics$" - }, - { - "pattern": "^#" - } - ], - "replacementPatterns": [ - { - "pattern": "^/", - "replacement": "{{BASEURL}}/" - }, - { - "pattern": "^https://github.com/open-telemetry/semantic-conventions/(blob|tree)/main/docs/", - "replacement": "LINK-CHECK-ERROR-USE-LOCAL-PATH-TO-DOC-PAGE-NOT-EXTERNAL-URL/" - } - ], - "httpHeaders": [ - { - "urls": ["http", ".", "/"], - "headers": { - "User-Agent": "Mozilla/5.0 (compatible; OpenTelemetryDocsBot/1.0)" - } - } - ], - "retryOn429": true, - "timeout": "30s", - "aliveStatusCodes": [200, 403] -} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4331414084..111d35baa9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -169,7 +169,23 @@ You can also take examples from past changes inside the `schemas` folder. ### 2. Update the markdown files After updating the YAML file(s), you need to update -the respective markdown files. For this, run the following commands: +the respective markdown files. +If you want to update existing tables, just run the following commands: + +```bash +make table-generation attribute-registry-generation +``` + +When defining new telemetry signals (spans, metrics, events, resources) in YAML, +make sure to add a new markdown section describing them. Add the following +code-snippet into the markdown file: + +``` + + +``` + +Then run markdown generation commands: ```bash make table-generation attribute-registry-generation diff --git a/Makefile b/Makefile index 813a09c639..722b76edbe 100644 --- a/Makefile +++ b/Makefile @@ -68,16 +68,23 @@ misspell-correction: $(MISSPELL) .PHONY: markdown-link-check markdown-link-check: - @if ! npm ls markdown-link-check; then npm install; fi - @for f in $(ALL_DOCS); do \ - npx --no -- markdown-link-check --quiet --config .markdown_link_check_config.json $$f \ - || exit 1; \ - done + docker run --rm \ + --mount 'type=bind,source=$(PWD),target=/home/repo' \ + lycheeverse/lychee \ + --config home/repo/.lychee.toml \ + --root-dir /home/repo \ + --verbose \ + home/repo .PHONY: markdown-link-check-changelog-preview markdown-link-check-changelog-preview: - @if ! npm ls markdown-link-check; then npm install; fi - npx --no -- markdown-link-check --quiet --config .markdown_link_check_config.json changelog_preview.md; + docker run --rm \ + --mount 'type=bind,source=$(PWD),target=/home/repo' \ + lycheeverse/lychee \ + --config /home/repo/.lychee.toml \ + --root-dir /home/repo \ + --verbose \ + home/repo/changelog_preview.md # This target runs markdown-toc on all files that contain # a comment . @@ -101,17 +108,8 @@ markdown-toc: .PHONY: markdownlint markdownlint: - @if ! npm ls markdownlint; then npm install; fi - @npx gulp lint-md - -.PHONY: markdownlint-old -markdownlint-old: - @if ! npm ls markdownlint; then npm install; fi - @for f in $(ALL_DOCS); do \ - echo $$f; \ - npx --no -p markdownlint-cli markdownlint -c .markdownlint.yaml $$f \ - || exit 1; \ - done + @if ! npm ls markdownlint-cli; then npm install; fi + npx --no -- markdownlint-cli -c .markdownlint.yaml $(ALL_DOCS) .PHONY: install-yamllint install-yamllint: diff --git a/dependencies.Dockerfile b/dependencies.Dockerfile index 18b420c661..f48a728de0 100644 --- a/dependencies.Dockerfile +++ b/dependencies.Dockerfile @@ -6,7 +6,7 @@ FROM otel/weaver:v0.12.0 AS weaver # OPA is used to test policies enforced by weaver. -FROM openpolicyagent/opa:0.70.0 AS opa +FROM openpolicyagent/opa:1.0.0 AS opa # Semconv gen is used for backwards compatibility checks. # TODO(jsuereth): Remove this when no longer used. diff --git a/docs/README.md b/docs/README.md index 37a3e92c49..a56aa665e1 100644 --- a/docs/README.md +++ b/docs/README.md @@ -22,6 +22,7 @@ Semantic Conventions are defined for the following areas: * **[General](general/README.md): General Semantic Conventions**. * [CICD](cicd/cicd-metrics.md): Semantic Conventions for CICD systems. +* [Code](code/README.md): Semantic Conventions for code. * [Cloud Providers](cloud-providers/README.md): Semantic Conventions for cloud providers libraries. * [CloudEvents](cloudevents/README.md): Semantic Conventions for the CloudEvents specification. * [Database](database/README.md): Semantic Conventions for database operations. diff --git a/docs/attributes-registry/code.md b/docs/attributes-registry/code.md index 8621728ce4..05be287a26 100644 --- a/docs/attributes-registry/code.md +++ b/docs/attributes-registry/code.md @@ -6,15 +6,29 @@ # Code +- [Code Attributes](#code-attributes) +- [Deprecated Code Attributes](#deprecated-code-attributes) + ## Code Attributes -These attributes allow to report this unit of code and therefore to provide more context about the span. +These attributes provide context about source code | Attribute | Type | Description | Examples | Stability | |---|---|---|---|---| -| `code.column` | int | The column number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`. | `16` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `code.filepath` | string | The source code file name that identifies the code unit as uniquely as possible (preferably an absolute file path). | `/usr/local/MyApplication/content_root/app/index.php` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `code.function` | string | The method or function name, or equivalent (usually rightmost part of the code unit's name). | `serveRequest` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `code.lineno` | int | The line number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`. | `42` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `code.namespace` | string | The "namespace" within which `code.function` is defined. Usually the qualified class or module name, such that `code.namespace` + some separator + `code.function` form a unique identifier for the code unit. | `com.example.MyHttpService` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `code.column.number` | int | The column number in `code.file.path` best representing the operation. It SHOULD point within the code unit named in `code.function.name`. | `16` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `code.file.path` | string | The source code file name that identifies the code unit as uniquely as possible (preferably an absolute file path). | `/usr/local/MyApplication/content_root/app/index.php` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `code.function.name` | string | The method or function name, or equivalent (usually rightmost part of the code unit's name). | `serveRequest` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `code.line.number` | int | The line number in `code.file.path` best representing the operation. It SHOULD point within the code unit named in `code.function.name`. | `42` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `code.namespace` | string | The "namespace" within which `code.function.name` is defined. Usually the qualified class or module name, such that `code.namespace` + some separator + `code.function.name` form a unique identifier for the code unit. | `com.example.MyHttpService` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `code.stacktrace` | string | A stacktrace as a string in the natural representation for the language runtime. The representation is to be determined and documented by each language SIG. | `at com.example.GenerateTrace.methodB(GenerateTrace.java:13)\n at com.example.GenerateTrace.methodA(GenerateTrace.java:9)\n at com.example.GenerateTrace.main(GenerateTrace.java:5)` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + +## Deprecated Code Attributes + +These deprecated attributes provide context about source code + +| Attribute | Type | Description | Examples | Stability | +|---|---|---|---|---| +| `code.column` | int | Deprecated, use `code.column.number` | `16` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `code.column.number` | +| `code.filepath` | string | Deprecated, use `code.file.path` instead | `/usr/local/MyApplication/content_root/app/index.php` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `code.function` | string | Deprecated, use `code.function.name` instead | `serveRequest` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `code.function.name` | +| `code.lineno` | int | Deprecated, use `code.line.number` instead | `42` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `code.line.number` | diff --git a/docs/attributes-registry/faas.md b/docs/attributes-registry/faas.md index 24cbfd3cfe..5447855f40 100644 --- a/docs/attributes-registry/faas.md +++ b/docs/attributes-registry/faas.md @@ -42,7 +42,7 @@ FaaS attributes **[6] `faas.name`:** This is the name of the function as configured/deployed on the FaaS platform and is usually different from the name of the callback function (which may be stored in the -[`code.namespace`/`code.function`](/docs/general/attributes.md#source-code-attributes) +[`code.namespace`/`code.function.name`](/docs/general/attributes.md#source-code-attributes) span attributes). For some cloud providers, the above definition is ambiguous. The following diff --git a/docs/attributes-registry/gen-ai.md b/docs/attributes-registry/gen-ai.md index 5ada7b3cdb..61a0b08cce 100644 --- a/docs/attributes-registry/gen-ai.md +++ b/docs/attributes-registry/gen-ai.md @@ -44,8 +44,10 @@ This document defines the attributes used to describe telemetry in the context o by `gen_ai.request.model` and `gen_ai.response.model` attributes. The actual GenAI product may differ from the one identified by the client. -For example, when using OpenAI client libraries to communicate with Mistral, the `gen_ai.system` -is set to `openai` based on the instrumentation's best knowledge. +Multiple systems, including Azure OpenAI and Gemini, are accessible by OpenAI client +libraries. In such cases, the `gen_ai.system` is set to `openai` based on the +instrumentation's best knowledge, instead of the actual system. The `server.address` +attribute may help identify the actual system in use for `openai`. For custom model, a custom friendly name SHOULD be used. If none of these options apply, the `gen_ai.system` SHOULD be set to `_OTHER`. @@ -69,10 +71,16 @@ If none of these options apply, the `gen_ai.system` SHOULD be set to `_OTHER`. | `anthropic` | Anthropic | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `aws.bedrock` | AWS Bedrock | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `az.ai.inference` | Azure AI Inference | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `az.ai.openai` | Azure OpenAI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `cohere` | Cohere | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `deepseek` | DeepSeek | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `gemini` | Gemini | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `groq` | Groq | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `ibm.watsonx.ai` | IBM Watsonx AI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `openai` | OpenAI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `perplexity` | Perplexity | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `vertex_ai` | Vertex AI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `xai` | xAI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | --- diff --git a/docs/attributes-registry/rpc.md b/docs/attributes-registry/rpc.md index 52cf593508..0a18185637 100644 --- a/docs/attributes-registry/rpc.md +++ b/docs/attributes-registry/rpc.md @@ -43,7 +43,7 @@ This document defines attributes for remote procedure calls. **[5] `rpc.message.id`:** This way we guarantee that the values will be consistent between different implementations. -**[6] `rpc.method`:** This is the logical name of the method from the RPC interface perspective, which can be different from the name of any implementing method/function. The `code.function` attribute may be used to store the latter (e.g., method actually executing the call on the server side, RPC client stub method on the client side). +**[6] `rpc.method`:** This is the logical name of the method from the RPC interface perspective, which can be different from the name of any implementing method/function. The `code.function.name` attribute may be used to store the latter (e.g., method actually executing the call on the server side, RPC client stub method on the client side). **[7] `rpc.service`:** This is the logical name of the service from the RPC interface perspective, which can be different from the name of any implementing class. The `code.namespace` attribute may be used to store the latter (despite the attribute name, it may include a class name; e.g., class with method actually executing the call on the server side, RPC client stub class on the client side). diff --git a/docs/cloud-providers/aws-sdk.md b/docs/cloud-providers/aws-sdk.md index 2d2114c3b3..877f6399d3 100644 --- a/docs/cloud-providers/aws-sdk.md +++ b/docs/cloud-providers/aws-sdk.md @@ -39,7 +39,7 @@ with the naming guidelines for RPC client spans. | [`rpc.method`](/docs/attributes-registry/rpc.md) | string | The name of the operation corresponding to the request, as returned by the AWS SDK [1] | `GetItem`; `PutItem` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`rpc.service`](/docs/attributes-registry/rpc.md) | string | The name of the service to which a request is made, as returned by the AWS SDK. [2] | `DynamoDB`; `S3` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -**[1] `rpc.method`:** This is the logical name of the method from the RPC interface perspective, which can be different from the name of any implementing method/function. The `code.function` attribute may be used to store the latter (e.g., method actually executing the call on the server side, RPC client stub method on the client side). +**[1] `rpc.method`:** This is the logical name of the method from the RPC interface perspective, which can be different from the name of any implementing method/function. The `code.function.name` attribute may be used to store the latter (e.g., method actually executing the call on the server side, RPC client stub method on the client side). **[2] `rpc.service`:** This is the logical name of the service from the RPC interface perspective, which can be different from the name of any implementing class. The `code.namespace` attribute may be used to store the latter (despite the attribute name, it may include a class name; e.g., class with method actually executing the call on the server side, RPC client stub class on the client side). diff --git a/docs/code/README.md b/docs/code/README.md new file mode 100644 index 0000000000..ddcbdd1ba0 --- /dev/null +++ b/docs/code/README.md @@ -0,0 +1,23 @@ + + +# Semantic Conventions for Code + +**Status**: [Experimental][DocumentStatus] + +This document defines semantic conventions for source code. + +> **Warning** +> +> Existing code instrumentations that are using +> [v1.29.0 of `code` conventions](https://github.com/open-telemetry/semantic-conventions/blob/v1.29.0/docs/attributes-registry/code.md) +> (or prior): +> +> * SHOULD NOT change the version of the `code` conventions that they emit by default + > until the `code` semantic conventions are marked stable. + +[DocumentStatus]: https://opentelemetry.io/docs/specs/otel/document-status diff --git a/docs/database/dynamodb.md b/docs/database/dynamodb.md index fb11c89316..6f97387874 100644 --- a/docs/database/dynamodb.md +++ b/docs/database/dynamodb.md @@ -30,7 +30,7 @@ The Semantic Conventions for [AWS DynamoDB](https://aws.amazon.com/dynamodb/) ex | [`rpc.method`](/docs/attributes-registry/rpc.md) | string | The name of the operation corresponding to the request, as returned by the AWS SDK [1] | `GetItem`; `PutItem` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`rpc.service`](/docs/attributes-registry/rpc.md) | string | The name of the service to which a request is made, as returned by the AWS SDK. [2] | `DynamoDB`; `S3` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -**[1] `rpc.method`:** This is the logical name of the method from the RPC interface perspective, which can be different from the name of any implementing method/function. The `code.function` attribute may be used to store the latter (e.g., method actually executing the call on the server side, RPC client stub method on the client side). +**[1] `rpc.method`:** This is the logical name of the method from the RPC interface perspective, which can be different from the name of any implementing method/function. The `code.function.name` attribute may be used to store the latter (e.g., method actually executing the call on the server side, RPC client stub method on the client side). **[2] `rpc.service`:** This is the logical name of the service from the RPC interface perspective, which can be different from the name of any implementing class. The `code.namespace` attribute may be used to store the latter (despite the attribute name, it may include a class name; e.g., class with method actually executing the call on the server side, RPC client stub class on the client side). @@ -71,7 +71,7 @@ The Semantic Conventions for [AWS DynamoDB](https://aws.amazon.com/dynamodb/) ex | [`rpc.method`](/docs/attributes-registry/rpc.md) | string | The name of the operation corresponding to the request, as returned by the AWS SDK [1] | `GetItem`; `PutItem` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`rpc.service`](/docs/attributes-registry/rpc.md) | string | The name of the service to which a request is made, as returned by the AWS SDK. [2] | `DynamoDB`; `S3` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -**[1] `rpc.method`:** This is the logical name of the method from the RPC interface perspective, which can be different from the name of any implementing method/function. The `code.function` attribute may be used to store the latter (e.g., method actually executing the call on the server side, RPC client stub method on the client side). +**[1] `rpc.method`:** This is the logical name of the method from the RPC interface perspective, which can be different from the name of any implementing method/function. The `code.function.name` attribute may be used to store the latter (e.g., method actually executing the call on the server side, RPC client stub method on the client side). **[2] `rpc.service`:** This is the logical name of the service from the RPC interface perspective, which can be different from the name of any implementing class. The `code.namespace` attribute may be used to store the latter (despite the attribute name, it may include a class name; e.g., class with method actually executing the call on the server side, RPC client stub class on the client side). @@ -116,7 +116,7 @@ The Semantic Conventions for [AWS DynamoDB](https://aws.amazon.com/dynamodb/) ex | [`rpc.method`](/docs/attributes-registry/rpc.md) | string | The name of the operation corresponding to the request, as returned by the AWS SDK [1] | `GetItem`; `PutItem` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`rpc.service`](/docs/attributes-registry/rpc.md) | string | The name of the service to which a request is made, as returned by the AWS SDK. [2] | `DynamoDB`; `S3` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -**[1] `rpc.method`:** This is the logical name of the method from the RPC interface perspective, which can be different from the name of any implementing method/function. The `code.function` attribute may be used to store the latter (e.g., method actually executing the call on the server side, RPC client stub method on the client side). +**[1] `rpc.method`:** This is the logical name of the method from the RPC interface perspective, which can be different from the name of any implementing method/function. The `code.function.name` attribute may be used to store the latter (e.g., method actually executing the call on the server side, RPC client stub method on the client side). **[2] `rpc.service`:** This is the logical name of the service from the RPC interface perspective, which can be different from the name of any implementing class. The `code.namespace` attribute may be used to store the latter (despite the attribute name, it may include a class name; e.g., class with method actually executing the call on the server side, RPC client stub class on the client side). @@ -157,7 +157,7 @@ The Semantic Conventions for [AWS DynamoDB](https://aws.amazon.com/dynamodb/) ex | [`rpc.method`](/docs/attributes-registry/rpc.md) | string | The name of the operation corresponding to the request, as returned by the AWS SDK [1] | `GetItem`; `PutItem` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`rpc.service`](/docs/attributes-registry/rpc.md) | string | The name of the service to which a request is made, as returned by the AWS SDK. [2] | `DynamoDB`; `S3` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -**[1] `rpc.method`:** This is the logical name of the method from the RPC interface perspective, which can be different from the name of any implementing method/function. The `code.function` attribute may be used to store the latter (e.g., method actually executing the call on the server side, RPC client stub method on the client side). +**[1] `rpc.method`:** This is the logical name of the method from the RPC interface perspective, which can be different from the name of any implementing method/function. The `code.function.name` attribute may be used to store the latter (e.g., method actually executing the call on the server side, RPC client stub method on the client side). **[2] `rpc.service`:** This is the logical name of the service from the RPC interface perspective, which can be different from the name of any implementing class. The `code.namespace` attribute may be used to store the latter (despite the attribute name, it may include a class name; e.g., class with method actually executing the call on the server side, RPC client stub class on the client side). @@ -196,7 +196,7 @@ The Semantic Conventions for [AWS DynamoDB](https://aws.amazon.com/dynamodb/) ex | [`rpc.method`](/docs/attributes-registry/rpc.md) | string | The name of the operation corresponding to the request, as returned by the AWS SDK [1] | `GetItem`; `PutItem` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`rpc.service`](/docs/attributes-registry/rpc.md) | string | The name of the service to which a request is made, as returned by the AWS SDK. [2] | `DynamoDB`; `S3` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -**[1] `rpc.method`:** This is the logical name of the method from the RPC interface perspective, which can be different from the name of any implementing method/function. The `code.function` attribute may be used to store the latter (e.g., method actually executing the call on the server side, RPC client stub method on the client side). +**[1] `rpc.method`:** This is the logical name of the method from the RPC interface perspective, which can be different from the name of any implementing method/function. The `code.function.name` attribute may be used to store the latter (e.g., method actually executing the call on the server side, RPC client stub method on the client side). **[2] `rpc.service`:** This is the logical name of the service from the RPC interface perspective, which can be different from the name of any implementing class. The `code.namespace` attribute may be used to store the latter (despite the attribute name, it may include a class name; e.g., class with method actually executing the call on the server side, RPC client stub class on the client side). @@ -235,7 +235,7 @@ The Semantic Conventions for [AWS DynamoDB](https://aws.amazon.com/dynamodb/) ex | [`rpc.method`](/docs/attributes-registry/rpc.md) | string | The name of the operation corresponding to the request, as returned by the AWS SDK [1] | `GetItem`; `PutItem` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`rpc.service`](/docs/attributes-registry/rpc.md) | string | The name of the service to which a request is made, as returned by the AWS SDK. [2] | `DynamoDB`; `S3` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -**[1] `rpc.method`:** This is the logical name of the method from the RPC interface perspective, which can be different from the name of any implementing method/function. The `code.function` attribute may be used to store the latter (e.g., method actually executing the call on the server side, RPC client stub method on the client side). +**[1] `rpc.method`:** This is the logical name of the method from the RPC interface perspective, which can be different from the name of any implementing method/function. The `code.function.name` attribute may be used to store the latter (e.g., method actually executing the call on the server side, RPC client stub method on the client side). **[2] `rpc.service`:** This is the logical name of the service from the RPC interface perspective, which can be different from the name of any implementing class. The `code.namespace` attribute may be used to store the latter (despite the attribute name, it may include a class name; e.g., class with method actually executing the call on the server side, RPC client stub class on the client side). @@ -277,7 +277,7 @@ The Semantic Conventions for [AWS DynamoDB](https://aws.amazon.com/dynamodb/) ex | [`rpc.method`](/docs/attributes-registry/rpc.md) | string | The name of the operation corresponding to the request, as returned by the AWS SDK [1] | `GetItem`; `PutItem` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`rpc.service`](/docs/attributes-registry/rpc.md) | string | The name of the service to which a request is made, as returned by the AWS SDK. [2] | `DynamoDB`; `S3` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -**[1] `rpc.method`:** This is the logical name of the method from the RPC interface perspective, which can be different from the name of any implementing method/function. The `code.function` attribute may be used to store the latter (e.g., method actually executing the call on the server side, RPC client stub method on the client side). +**[1] `rpc.method`:** This is the logical name of the method from the RPC interface perspective, which can be different from the name of any implementing method/function. The `code.function.name` attribute may be used to store the latter (e.g., method actually executing the call on the server side, RPC client stub method on the client side). **[2] `rpc.service`:** This is the logical name of the service from the RPC interface perspective, which can be different from the name of any implementing class. The `code.namespace` attribute may be used to store the latter (despite the attribute name, it may include a class name; e.g., class with method actually executing the call on the server side, RPC client stub class on the client side). @@ -318,7 +318,7 @@ The Semantic Conventions for [AWS DynamoDB](https://aws.amazon.com/dynamodb/) ex | [`rpc.method`](/docs/attributes-registry/rpc.md) | string | The name of the operation corresponding to the request, as returned by the AWS SDK [1] | `GetItem`; `PutItem` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`rpc.service`](/docs/attributes-registry/rpc.md) | string | The name of the service to which a request is made, as returned by the AWS SDK. [2] | `DynamoDB`; `S3` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -**[1] `rpc.method`:** This is the logical name of the method from the RPC interface perspective, which can be different from the name of any implementing method/function. The `code.function` attribute may be used to store the latter (e.g., method actually executing the call on the server side, RPC client stub method on the client side). +**[1] `rpc.method`:** This is the logical name of the method from the RPC interface perspective, which can be different from the name of any implementing method/function. The `code.function.name` attribute may be used to store the latter (e.g., method actually executing the call on the server side, RPC client stub method on the client side). **[2] `rpc.service`:** This is the logical name of the service from the RPC interface perspective, which can be different from the name of any implementing class. The `code.namespace` attribute may be used to store the latter (despite the attribute name, it may include a class name; e.g., class with method actually executing the call on the server side, RPC client stub class on the client side). @@ -359,7 +359,7 @@ The Semantic Conventions for [AWS DynamoDB](https://aws.amazon.com/dynamodb/) ex | [`rpc.method`](/docs/attributes-registry/rpc.md) | string | The name of the operation corresponding to the request, as returned by the AWS SDK [1] | `GetItem`; `PutItem` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`rpc.service`](/docs/attributes-registry/rpc.md) | string | The name of the service to which a request is made, as returned by the AWS SDK. [2] | `DynamoDB`; `S3` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -**[1] `rpc.method`:** This is the logical name of the method from the RPC interface perspective, which can be different from the name of any implementing method/function. The `code.function` attribute may be used to store the latter (e.g., method actually executing the call on the server side, RPC client stub method on the client side). +**[1] `rpc.method`:** This is the logical name of the method from the RPC interface perspective, which can be different from the name of any implementing method/function. The `code.function.name` attribute may be used to store the latter (e.g., method actually executing the call on the server side, RPC client stub method on the client side). **[2] `rpc.service`:** This is the logical name of the service from the RPC interface perspective, which can be different from the name of any implementing class. The `code.namespace` attribute may be used to store the latter (despite the attribute name, it may include a class name; e.g., class with method actually executing the call on the server side, RPC client stub class on the client side). @@ -406,7 +406,7 @@ The Semantic Conventions for [AWS DynamoDB](https://aws.amazon.com/dynamodb/) ex | [`rpc.method`](/docs/attributes-registry/rpc.md) | string | The name of the operation corresponding to the request, as returned by the AWS SDK [1] | `GetItem`; `PutItem` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`rpc.service`](/docs/attributes-registry/rpc.md) | string | The name of the service to which a request is made, as returned by the AWS SDK. [2] | `DynamoDB`; `S3` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -**[1] `rpc.method`:** This is the logical name of the method from the RPC interface perspective, which can be different from the name of any implementing method/function. The `code.function` attribute may be used to store the latter (e.g., method actually executing the call on the server side, RPC client stub method on the client side). +**[1] `rpc.method`:** This is the logical name of the method from the RPC interface perspective, which can be different from the name of any implementing method/function. The `code.function.name` attribute may be used to store the latter (e.g., method actually executing the call on the server side, RPC client stub method on the client side). **[2] `rpc.service`:** This is the logical name of the service from the RPC interface perspective, which can be different from the name of any implementing class. The `code.namespace` attribute may be used to store the latter (despite the attribute name, it may include a class name; e.g., class with method actually executing the call on the server side, RPC client stub class on the client side). @@ -456,7 +456,7 @@ The Semantic Conventions for [AWS DynamoDB](https://aws.amazon.com/dynamodb/) ex | [`rpc.method`](/docs/attributes-registry/rpc.md) | string | The name of the operation corresponding to the request, as returned by the AWS SDK [1] | `GetItem`; `PutItem` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`rpc.service`](/docs/attributes-registry/rpc.md) | string | The name of the service to which a request is made, as returned by the AWS SDK. [2] | `DynamoDB`; `S3` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -**[1] `rpc.method`:** This is the logical name of the method from the RPC interface perspective, which can be different from the name of any implementing method/function. The `code.function` attribute may be used to store the latter (e.g., method actually executing the call on the server side, RPC client stub method on the client side). +**[1] `rpc.method`:** This is the logical name of the method from the RPC interface perspective, which can be different from the name of any implementing method/function. The `code.function.name` attribute may be used to store the latter (e.g., method actually executing the call on the server side, RPC client stub method on the client side). **[2] `rpc.service`:** This is the logical name of the service from the RPC interface perspective, which can be different from the name of any implementing class. The `code.namespace` attribute may be used to store the latter (despite the attribute name, it may include a class name; e.g., class with method actually executing the call on the server side, RPC client stub class on the client side). @@ -497,7 +497,7 @@ The Semantic Conventions for [AWS DynamoDB](https://aws.amazon.com/dynamodb/) ex | [`rpc.method`](/docs/attributes-registry/rpc.md) | string | The name of the operation corresponding to the request, as returned by the AWS SDK [1] | `GetItem`; `PutItem` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`rpc.service`](/docs/attributes-registry/rpc.md) | string | The name of the service to which a request is made, as returned by the AWS SDK. [2] | `DynamoDB`; `S3` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -**[1] `rpc.method`:** This is the logical name of the method from the RPC interface perspective, which can be different from the name of any implementing method/function. The `code.function` attribute may be used to store the latter (e.g., method actually executing the call on the server side, RPC client stub method on the client side). +**[1] `rpc.method`:** This is the logical name of the method from the RPC interface perspective, which can be different from the name of any implementing method/function. The `code.function.name` attribute may be used to store the latter (e.g., method actually executing the call on the server side, RPC client stub method on the client side). **[2] `rpc.service`:** This is the logical name of the service from the RPC interface perspective, which can be different from the name of any implementing class. The `code.namespace` attribute may be used to store the latter (despite the attribute name, it may include a class name; e.g., class with method actually executing the call on the server side, RPC client stub class on the client side). @@ -541,7 +541,7 @@ The Semantic Conventions for [AWS DynamoDB](https://aws.amazon.com/dynamodb/) ex | [`rpc.method`](/docs/attributes-registry/rpc.md) | string | The name of the operation corresponding to the request, as returned by the AWS SDK [1] | `GetItem`; `PutItem` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`rpc.service`](/docs/attributes-registry/rpc.md) | string | The name of the service to which a request is made, as returned by the AWS SDK. [2] | `DynamoDB`; `S3` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -**[1] `rpc.method`:** This is the logical name of the method from the RPC interface perspective, which can be different from the name of any implementing method/function. The `code.function` attribute may be used to store the latter (e.g., method actually executing the call on the server side, RPC client stub method on the client side). +**[1] `rpc.method`:** This is the logical name of the method from the RPC interface perspective, which can be different from the name of any implementing method/function. The `code.function.name` attribute may be used to store the latter (e.g., method actually executing the call on the server side, RPC client stub method on the client side). **[2] `rpc.service`:** This is the logical name of the service from the RPC interface perspective, which can be different from the name of any implementing class. The `code.namespace` attribute may be used to store the latter (despite the attribute name, it may include a class name; e.g., class with method actually executing the call on the server side, RPC client stub class on the client side). diff --git a/docs/gen-ai/azure-ai-inference.md b/docs/gen-ai/azure-ai-inference.md index ad9be5fb7a..5930182a4c 100644 --- a/docs/gen-ai/azure-ai-inference.md +++ b/docs/gen-ai/azure-ai-inference.md @@ -26,6 +26,7 @@ The Semantic Conventions for [Azure AI Inference](https://learn.microsoft.com/az | [`gen_ai.operation.name`](/docs/attributes-registry/gen-ai.md) | string | The name of the operation being performed. [1] | `chat`; `text_completion`; `embeddings` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`error.type`](/docs/attributes-registry/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/attributes-registry/gen-ai.md) | string | The name of the GenAI model a request is being made to. [3] | `gpt-4` | `Conditionally Required` If available. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`gen_ai.request.seed`](/docs/attributes-registry/gen-ai.md) | int | Requests with same seed value more likely to return same result. | `100` | `Conditionally Required` if appliable and if the request includes a seed | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`server.port`](/docs/attributes-registry/server.md) | int | GenAI server port. [4] | `80`; `8080`; `443` | `Conditionally Required` If not default (443). | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | [`az.namespace`](/docs/attributes-registry/azure.md) | string | [Azure Resource Provider Namespace](https://learn.microsoft.com/azure/azure-resource-manager/management/azure-services-resource-providers) as recognized by the client. [5] | `Microsoft.CognitiveServices` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`gen_ai.request.encoding_formats`](/docs/attributes-registry/gen-ai.md) | string[] | The encoding formats requested in an embeddings operation, if specified. [6] | `["base64"]`; `["float", "binary"]` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | diff --git a/docs/gen-ai/gen-ai-events.md b/docs/gen-ai/gen-ai-events.md index e7fa7c0beb..b43bb2578f 100644 --- a/docs/gen-ai/gen-ai-events.md +++ b/docs/gen-ai/gen-ai-events.md @@ -69,8 +69,10 @@ This event describes the system instructions passed to the GenAI model. by `gen_ai.request.model` and `gen_ai.response.model` attributes. The actual GenAI product may differ from the one identified by the client. -For example, when using OpenAI client libraries to communicate with Mistral, the `gen_ai.system` -is set to `openai` based on the instrumentation's best knowledge. +Multiple systems, including Azure OpenAI and Gemini, are accessible by OpenAI client +libraries. In such cases, the `gen_ai.system` is set to `openai` based on the +instrumentation's best knowledge, instead of the actual system. The `server.address` +attribute may help identify the actual system in use for `openai`. For custom model, a custom friendly name SHOULD be used. If none of these options apply, the `gen_ai.system` SHOULD be set to `_OTHER`. @@ -84,10 +86,16 @@ If none of these options apply, the `gen_ai.system` SHOULD be set to `_OTHER`. | `anthropic` | Anthropic | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `aws.bedrock` | AWS Bedrock | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `az.ai.inference` | Azure AI Inference | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `az.ai.openai` | Azure OpenAI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `cohere` | Cohere | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `deepseek` | DeepSeek | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `gemini` | Gemini | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `groq` | Groq | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `ibm.watsonx.ai` | IBM Watsonx AI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `openai` | OpenAI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `perplexity` | Perplexity | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `vertex_ai` | Vertex AI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `xai` | xAI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | **Body fields:** @@ -124,8 +132,10 @@ This event describes the user message passed to the GenAI model. by `gen_ai.request.model` and `gen_ai.response.model` attributes. The actual GenAI product may differ from the one identified by the client. -For example, when using OpenAI client libraries to communicate with Mistral, the `gen_ai.system` -is set to `openai` based on the instrumentation's best knowledge. +Multiple systems, including Azure OpenAI and Gemini, are accessible by OpenAI client +libraries. In such cases, the `gen_ai.system` is set to `openai` based on the +instrumentation's best knowledge, instead of the actual system. The `server.address` +attribute may help identify the actual system in use for `openai`. For custom model, a custom friendly name SHOULD be used. If none of these options apply, the `gen_ai.system` SHOULD be set to `_OTHER`. @@ -139,10 +149,16 @@ If none of these options apply, the `gen_ai.system` SHOULD be set to `_OTHER`. | `anthropic` | Anthropic | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `aws.bedrock` | AWS Bedrock | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `az.ai.inference` | Azure AI Inference | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `az.ai.openai` | Azure OpenAI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `cohere` | Cohere | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `deepseek` | DeepSeek | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `gemini` | Gemini | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `groq` | Groq | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `ibm.watsonx.ai` | IBM Watsonx AI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `openai` | OpenAI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `perplexity` | Perplexity | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `vertex_ai` | Vertex AI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `xai` | xAI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | **Body fields:** @@ -179,8 +195,10 @@ This event describes the assistant message passed to GenAI system. by `gen_ai.request.model` and `gen_ai.response.model` attributes. The actual GenAI product may differ from the one identified by the client. -For example, when using OpenAI client libraries to communicate with Mistral, the `gen_ai.system` -is set to `openai` based on the instrumentation's best knowledge. +Multiple systems, including Azure OpenAI and Gemini, are accessible by OpenAI client +libraries. In such cases, the `gen_ai.system` is set to `openai` based on the +instrumentation's best knowledge, instead of the actual system. The `server.address` +attribute may help identify the actual system in use for `openai`. For custom model, a custom friendly name SHOULD be used. If none of these options apply, the `gen_ai.system` SHOULD be set to `_OTHER`. @@ -194,10 +212,16 @@ If none of these options apply, the `gen_ai.system` SHOULD be set to `_OTHER`. | `anthropic` | Anthropic | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `aws.bedrock` | AWS Bedrock | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `az.ai.inference` | Azure AI Inference | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `az.ai.openai` | Azure OpenAI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `cohere` | Cohere | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `deepseek` | DeepSeek | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `gemini` | Gemini | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `groq` | Groq | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `ibm.watsonx.ai` | IBM Watsonx AI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `openai` | OpenAI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `perplexity` | Perplexity | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `vertex_ai` | Vertex AI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `xai` | xAI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | **Body fields:** @@ -249,8 +273,10 @@ This event describes the response from a tool or function call passed to the Gen by `gen_ai.request.model` and `gen_ai.response.model` attributes. The actual GenAI product may differ from the one identified by the client. -For example, when using OpenAI client libraries to communicate with Mistral, the `gen_ai.system` -is set to `openai` based on the instrumentation's best knowledge. +Multiple systems, including Azure OpenAI and Gemini, are accessible by OpenAI client +libraries. In such cases, the `gen_ai.system` is set to `openai` based on the +instrumentation's best knowledge, instead of the actual system. The `server.address` +attribute may help identify the actual system in use for `openai`. For custom model, a custom friendly name SHOULD be used. If none of these options apply, the `gen_ai.system` SHOULD be set to `_OTHER`. @@ -264,10 +290,16 @@ If none of these options apply, the `gen_ai.system` SHOULD be set to `_OTHER`. | `anthropic` | Anthropic | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `aws.bedrock` | AWS Bedrock | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `az.ai.inference` | Azure AI Inference | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `az.ai.openai` | Azure OpenAI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `cohere` | Cohere | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `deepseek` | DeepSeek | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `gemini` | Gemini | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `groq` | Groq | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `ibm.watsonx.ai` | IBM Watsonx AI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `openai` | OpenAI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `perplexity` | Perplexity | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `vertex_ai` | Vertex AI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `xai` | xAI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | **Body fields:** @@ -305,8 +337,10 @@ This event describes the Gen AI response message. by `gen_ai.request.model` and `gen_ai.response.model` attributes. The actual GenAI product may differ from the one identified by the client. -For example, when using OpenAI client libraries to communicate with Mistral, the `gen_ai.system` -is set to `openai` based on the instrumentation's best knowledge. +Multiple systems, including Azure OpenAI and Gemini, are accessible by OpenAI client +libraries. In such cases, the `gen_ai.system` is set to `openai` based on the +instrumentation's best knowledge, instead of the actual system. The `server.address` +attribute may help identify the actual system in use for `openai`. For custom model, a custom friendly name SHOULD be used. If none of these options apply, the `gen_ai.system` SHOULD be set to `_OTHER`. @@ -320,10 +354,16 @@ If none of these options apply, the `gen_ai.system` SHOULD be set to `_OTHER`. | `anthropic` | Anthropic | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `aws.bedrock` | AWS Bedrock | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `az.ai.inference` | Azure AI Inference | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `az.ai.openai` | Azure OpenAI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `cohere` | Cohere | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `deepseek` | DeepSeek | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `gemini` | Gemini | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `groq` | Groq | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `ibm.watsonx.ai` | IBM Watsonx AI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `openai` | OpenAI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `perplexity` | Perplexity | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `vertex_ai` | Vertex AI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `xai` | xAI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | **Body fields:** diff --git a/docs/gen-ai/gen-ai-metrics.md b/docs/gen-ai/gen-ai-metrics.md index f47e0b2280..ac473e6c76 100644 --- a/docs/gen-ai/gen-ai-metrics.md +++ b/docs/gen-ai/gen-ai-metrics.md @@ -75,8 +75,10 @@ This metric SHOULD be specified with [ExplicitBucketBoundaries] of [1, 4, 16, 64 by `gen_ai.request.model` and `gen_ai.response.model` attributes. The actual GenAI product may differ from the one identified by the client. -For example, when using OpenAI client libraries to communicate with Mistral, the `gen_ai.system` -is set to `openai` based on the instrumentation's best knowledge. +Multiple systems, including Azure OpenAI and Gemini, are accessible by OpenAI client +libraries. In such cases, the `gen_ai.system` is set to `openai` based on the +instrumentation's best knowledge, instead of the actual system. The `server.address` +attribute may help identify the actual system in use for `openai`. For custom model, a custom friendly name SHOULD be used. If none of these options apply, the `gen_ai.system` SHOULD be set to `_OTHER`. @@ -104,10 +106,16 @@ If none of these options apply, the `gen_ai.system` SHOULD be set to `_OTHER`. | `anthropic` | Anthropic | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `aws.bedrock` | AWS Bedrock | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `az.ai.inference` | Azure AI Inference | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `az.ai.openai` | Azure OpenAI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `cohere` | Cohere | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `deepseek` | DeepSeek | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `gemini` | Gemini | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `groq` | Groq | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `ibm.watsonx.ai` | IBM Watsonx AI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `openai` | OpenAI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `perplexity` | Perplexity | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `vertex_ai` | Vertex AI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `xai` | xAI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | --- @@ -156,8 +164,10 @@ This metric SHOULD be specified with [ExplicitBucketBoundaries] of [0.01, 0.02, by `gen_ai.request.model` and `gen_ai.response.model` attributes. The actual GenAI product may differ from the one identified by the client. -For example, when using OpenAI client libraries to communicate with Mistral, the `gen_ai.system` -is set to `openai` based on the instrumentation's best knowledge. +Multiple systems, including Azure OpenAI and Gemini, are accessible by OpenAI client +libraries. In such cases, the `gen_ai.system` is set to `openai` based on the +instrumentation's best knowledge, instead of the actual system. The `server.address` +attribute may help identify the actual system in use for `openai`. For custom model, a custom friendly name SHOULD be used. If none of these options apply, the `gen_ai.system` SHOULD be set to `_OTHER`. @@ -197,10 +207,16 @@ Instrumentations SHOULD document the list of errors they report. | `anthropic` | Anthropic | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `aws.bedrock` | AWS Bedrock | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `az.ai.inference` | Azure AI Inference | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `az.ai.openai` | Azure OpenAI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `cohere` | Cohere | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `deepseek` | DeepSeek | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `gemini` | Gemini | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `groq` | Groq | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `ibm.watsonx.ai` | IBM Watsonx AI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `openai` | OpenAI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `perplexity` | Perplexity | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `vertex_ai` | Vertex AI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `xai` | xAI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | @@ -247,8 +263,10 @@ This metric SHOULD be specified with [ExplicitBucketBoundaries] of by `gen_ai.request.model` and `gen_ai.response.model` attributes. The actual GenAI product may differ from the one identified by the client. -For example, when using OpenAI client libraries to communicate with Mistral, the `gen_ai.system` -is set to `openai` based on the instrumentation's best knowledge. +Multiple systems, including Azure OpenAI and Gemini, are accessible by OpenAI client +libraries. In such cases, the `gen_ai.system` is set to `openai` based on the +instrumentation's best knowledge, instead of the actual system. The `server.address` +attribute may help identify the actual system in use for `openai`. For custom model, a custom friendly name SHOULD be used. If none of these options apply, the `gen_ai.system` SHOULD be set to `_OTHER`. @@ -288,10 +306,16 @@ Instrumentations SHOULD document the list of errors they report. | `anthropic` | Anthropic | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `aws.bedrock` | AWS Bedrock | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `az.ai.inference` | Azure AI Inference | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `az.ai.openai` | Azure OpenAI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `cohere` | Cohere | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `deepseek` | DeepSeek | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `gemini` | Gemini | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `groq` | Groq | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `ibm.watsonx.ai` | IBM Watsonx AI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `openai` | OpenAI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `perplexity` | Perplexity | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `vertex_ai` | Vertex AI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `xai` | xAI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | @@ -337,8 +361,10 @@ This metric SHOULD be specified with [ExplicitBucketBoundaries] of by `gen_ai.request.model` and `gen_ai.response.model` attributes. The actual GenAI product may differ from the one identified by the client. -For example, when using OpenAI client libraries to communicate with Mistral, the `gen_ai.system` -is set to `openai` based on the instrumentation's best knowledge. +Multiple systems, including Azure OpenAI and Gemini, are accessible by OpenAI client +libraries. In such cases, the `gen_ai.system` is set to `openai` based on the +instrumentation's best knowledge, instead of the actual system. The `server.address` +attribute may help identify the actual system in use for `openai`. For custom model, a custom friendly name SHOULD be used. If none of these options apply, the `gen_ai.system` SHOULD be set to `_OTHER`. @@ -366,10 +392,16 @@ If none of these options apply, the `gen_ai.system` SHOULD be set to `_OTHER`. | `anthropic` | Anthropic | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `aws.bedrock` | AWS Bedrock | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `az.ai.inference` | Azure AI Inference | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `az.ai.openai` | Azure OpenAI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `cohere` | Cohere | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `deepseek` | DeepSeek | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `gemini` | Gemini | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `groq` | Groq | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `ibm.watsonx.ai` | IBM Watsonx AI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `openai` | OpenAI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `perplexity` | Perplexity | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `vertex_ai` | Vertex AI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `xai` | xAI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | @@ -414,8 +446,10 @@ This metric SHOULD be specified with [ExplicitBucketBoundaries] of by `gen_ai.request.model` and `gen_ai.response.model` attributes. The actual GenAI product may differ from the one identified by the client. -For example, when using OpenAI client libraries to communicate with Mistral, the `gen_ai.system` -is set to `openai` based on the instrumentation's best knowledge. +Multiple systems, including Azure OpenAI and Gemini, are accessible by OpenAI client +libraries. In such cases, the `gen_ai.system` is set to `openai` based on the +instrumentation's best knowledge, instead of the actual system. The `server.address` +attribute may help identify the actual system in use for `openai`. For custom model, a custom friendly name SHOULD be used. If none of these options apply, the `gen_ai.system` SHOULD be set to `_OTHER`. @@ -443,10 +477,16 @@ If none of these options apply, the `gen_ai.system` SHOULD be set to `_OTHER`. | `anthropic` | Anthropic | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `aws.bedrock` | AWS Bedrock | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `az.ai.inference` | Azure AI Inference | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `az.ai.openai` | Azure OpenAI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `cohere` | Cohere | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `deepseek` | DeepSeek | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `gemini` | Gemini | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `groq` | Groq | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `ibm.watsonx.ai` | IBM Watsonx AI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `openai` | OpenAI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `perplexity` | Perplexity | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `vertex_ai` | Vertex AI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `xai` | xAI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | diff --git a/docs/gen-ai/gen-ai-spans.md b/docs/gen-ai/gen-ai-spans.md index 70c8d3d5bf..24a70cade6 100644 --- a/docs/gen-ai/gen-ai-spans.md +++ b/docs/gen-ai/gen-ai-spans.md @@ -48,6 +48,7 @@ Many of these attributes only apply to specific GenAI operations. For example, G | [`gen_ai.system`](/docs/attributes-registry/gen-ai.md) | string | The Generative AI product as identified by the client or server instrumentation. [2] | `openai` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`error.type`](/docs/attributes-registry/error.md) | string | Describes a class of error the operation ended with. [3] | `timeout`; `java.net.UnknownHostException`; `server_certificate_invalid`; `500` | `Conditionally Required` if the operation ended in an error | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | [`gen_ai.request.model`](/docs/attributes-registry/gen-ai.md) | string | The name of the GenAI model a request is being made to. [4] | `gpt-4` | `Conditionally Required` If available. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`gen_ai.request.seed`](/docs/attributes-registry/gen-ai.md) | int | Requests with same seed value more likely to return same result. | `100` | `Conditionally Required` if appliable and if the request includes a seed | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`server.port`](/docs/attributes-registry/server.md) | int | GenAI server port. [5] | `80`; `8080`; `443` | `Conditionally Required` If `server.address` is set. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | [`gen_ai.request.encoding_formats`](/docs/attributes-registry/gen-ai.md) | string[] | The encoding formats requested in an embeddings operation, if specified. [6] | `["base64"]`; `["float", "binary"]` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`gen_ai.request.frequency_penalty`](/docs/attributes-registry/gen-ai.md) | double | The frequency penalty setting for the GenAI request. | `0.1` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | @@ -70,8 +71,10 @@ Many of these attributes only apply to specific GenAI operations. For example, G by `gen_ai.request.model` and `gen_ai.response.model` attributes. The actual GenAI product may differ from the one identified by the client. -For example, when using OpenAI client libraries to communicate with Mistral, the `gen_ai.system` -is set to `openai` based on the instrumentation's best knowledge. +Multiple systems, including Azure OpenAI and Gemini, are accessible by OpenAI client +libraries. In such cases, the `gen_ai.system` is set to `openai` based on the +instrumentation's best knowledge, instead of the actual system. The `server.address` +attribute may help identify the actual system in use for `openai`. For custom model, a custom friendly name SHOULD be used. If none of these options apply, the `gen_ai.system` SHOULD be set to `_OTHER`. @@ -117,10 +120,16 @@ Instrumentations SHOULD document the list of errors they report. | `anthropic` | Anthropic | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `aws.bedrock` | AWS Bedrock | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `az.ai.inference` | Azure AI Inference | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `az.ai.openai` | Azure OpenAI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `cohere` | Cohere | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `deepseek` | DeepSeek | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `gemini` | Gemini | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `groq` | Groq | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `ibm.watsonx.ai` | IBM Watsonx AI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `openai` | OpenAI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `perplexity` | Perplexity | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `vertex_ai` | Vertex AI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `xai` | xAI | ![Experimental](https://img.shields.io/badge/-experimental-blue) | diff --git a/docs/gen-ai/openai.md b/docs/gen-ai/openai.md index 35b274b17a..6496fd5663 100644 --- a/docs/gen-ai/openai.md +++ b/docs/gen-ai/openai.md @@ -40,9 +40,9 @@ attributes and ones specific the OpenAI. | [`gen_ai.request.model`](/docs/attributes-registry/gen-ai.md) | string | The name of the GenAI model a request is being made to. [2] | `gpt-4` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`error.type`](/docs/attributes-registry/error.md) | string | Describes a class of error the operation ended with. [3] | `timeout`; `java.net.UnknownHostException`; `server_certificate_invalid`; `500` | `Conditionally Required` if the operation ended in an error | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | [`gen_ai.openai.request.response_format`](/docs/attributes-registry/gen-ai.md) | string | The response format that is requested. | `json` | `Conditionally Required` if the request includes a response_format | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`gen_ai.openai.request.seed`](/docs/attributes-registry/gen-ai.md) | int | Deprecated, use `gen_ai.request.seed`. | `100` | `Conditionally Required` if the request includes a seed | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `gen_ai.request.seed` attribute. | | [`gen_ai.openai.request.service_tier`](/docs/attributes-registry/gen-ai.md) | string | The service tier requested. May be a specific tier, default, or auto. | `auto`; `default` | `Conditionally Required` [4] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`gen_ai.openai.response.service_tier`](/docs/attributes-registry/gen-ai.md) | string | The service tier used for the response. | `scale`; `default` | `Conditionally Required` [5] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`gen_ai.request.seed`](/docs/attributes-registry/gen-ai.md) | int | Requests with same seed value more likely to return same result. | `100` | `Conditionally Required` if appliable and if the request includes a seed | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`server.port`](/docs/attributes-registry/server.md) | int | GenAI server port. [6] | `80`; `8080`; `443` | `Conditionally Required` If `server.address` is set. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | [`gen_ai.openai.response.system_fingerprint`](/docs/attributes-registry/gen-ai.md) | string | A fingerprint to track any eventual change in the Generative AI environment. | `fp_44709d6fcb` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`gen_ai.request.encoding_formats`](/docs/attributes-registry/gen-ai.md) | string[] | The encoding formats requested in an embeddings operation, if specified. [7] | `["base64"]`; `["float", "binary"]` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | diff --git a/docs/general/attributes.md b/docs/general/attributes.md index 601b43101d..7366d37865 100644 --- a/docs/general/attributes.md +++ b/docs/general/attributes.md @@ -489,11 +489,11 @@ about the span. | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| -| [`code.column`](/docs/attributes-registry/code.md) | int | The column number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`. | `16` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`code.filepath`](/docs/attributes-registry/code.md) | string | The source code file name that identifies the code unit as uniquely as possible (preferably an absolute file path). | `/usr/local/MyApplication/content_root/app/index.php` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`code.function`](/docs/attributes-registry/code.md) | string | The method or function name, or equivalent (usually rightmost part of the code unit's name). | `serveRequest` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`code.lineno`](/docs/attributes-registry/code.md) | int | The line number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`. | `42` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`code.namespace`](/docs/attributes-registry/code.md) | string | The "namespace" within which `code.function` is defined. Usually the qualified class or module name, such that `code.namespace` + some separator + `code.function` form a unique identifier for the code unit. | `com.example.MyHttpService` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`code.column.number`](/docs/attributes-registry/code.md) | int | The column number in `code.file.path` best representing the operation. It SHOULD point within the code unit named in `code.function.name`. | `16` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`code.filepath`](/docs/attributes-registry/code.md) | string | Deprecated, use `code.file.path` instead | `/usr/local/MyApplication/content_root/app/index.php` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`code.function.name`](/docs/attributes-registry/code.md) | string | The method or function name, or equivalent (usually rightmost part of the code unit's name). | `serveRequest` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`code.line.number`](/docs/attributes-registry/code.md) | int | The line number in `code.file.path` best representing the operation. It SHOULD point within the code unit named in `code.function.name`. | `42` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`code.namespace`](/docs/attributes-registry/code.md) | string | The "namespace" within which `code.function.name` is defined. Usually the qualified class or module name, such that `code.namespace` + some separator + `code.function.name` form a unique identifier for the code unit. | `com.example.MyHttpService` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`code.stacktrace`](/docs/attributes-registry/code.md) | string | A stacktrace as a string in the natural representation for the language runtime. The representation is to be determined and documented by each language SIG. | `at com.example.GenerateTrace.methodB(GenerateTrace.java:13)\n at com.example.GenerateTrace.methodA(GenerateTrace.java:9)\n at com.example.GenerateTrace.main(GenerateTrace.java:5)` | `Opt-In` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | diff --git a/docs/general/naming.md b/docs/general/naming.md index 51b04cd7af..62921a4ae9 100644 --- a/docs/general/naming.md +++ b/docs/general/naming.md @@ -193,7 +193,7 @@ OpenTelemetry specification. might include multiple values: the executable name and command arguments. - When an attribute represents a measurement, - [Metric Name Pluralization Guidelines](./metrics.md#pluralization) SHOULD be + [Name Pluralization Guidelines](./naming.md#pluralization) SHOULD be followed for the attribute name. ### Signal-specific Attributes diff --git a/docs/hardware/README.md b/docs/hardware/README.md index 6b7f098cbe..13d1470f86 100644 --- a/docs/hardware/README.md +++ b/docs/hardware/README.md @@ -7,7 +7,7 @@ linkTitle: Hardware **Status**: [Experimental][DocumentStatus] This document describes instruments and attributes for common hardware level -metrics in OpenTelemetry. Consider the [general metric semantic conventions](/docs/general/metrics.md#general-metric-semantic-conventions) +metrics in OpenTelemetry. Consider the [general metric semantic conventions](/docs/general/metrics.md#general-guidelines) when creating instruments not explicitly defined in the specification. Semantic conventions for hardware are defined as following: diff --git a/docs/object-stores/s3.md b/docs/object-stores/s3.md index 2de5d4a3d6..42ce54fad7 100644 --- a/docs/object-stores/s3.md +++ b/docs/object-stores/s3.md @@ -78,7 +78,7 @@ This applies in particular to the following operations: - [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html) - [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html) -**[7] `rpc.method`:** This is the logical name of the method from the RPC interface perspective, which can be different from the name of any implementing method/function. The `code.function` attribute may be used to store the latter (e.g., method actually executing the call on the server side, RPC client stub method on the client side). +**[7] `rpc.method`:** This is the logical name of the method from the RPC interface perspective, which can be different from the name of any implementing method/function. The `code.function.name` attribute may be used to store the latter (e.g., method actually executing the call on the server side, RPC client stub method on the client side). **[8] `rpc.service`:** This is the logical name of the service from the RPC interface perspective, which can be different from the name of any implementing class. The `code.namespace` attribute may be used to store the latter (despite the attribute name, it may include a class name; e.g., class with method actually executing the call on the server side, RPC client stub class on the client side). diff --git a/docs/resource/faas.md b/docs/resource/faas.md index 0bd52a608e..6aeac236bf 100644 --- a/docs/resource/faas.md +++ b/docs/resource/faas.md @@ -32,7 +32,7 @@ See also: **[1] `faas.name`:** This is the name of the function as configured/deployed on the FaaS platform and is usually different from the name of the callback function (which may be stored in the -[`code.namespace`/`code.function`](/docs/general/attributes.md#source-code-attributes) +[`code.namespace`/`code.function.name`](/docs/general/attributes.md#source-code-attributes) span attributes). For some cloud providers, the above definition is ambiguous. The following diff --git a/docs/rpc/rpc-metrics.md b/docs/rpc/rpc-metrics.md index 058cba2920..787e39e814 100644 --- a/docs/rpc/rpc-metrics.md +++ b/docs/rpc/rpc-metrics.md @@ -341,7 +341,7 @@ different processes could be listening on TCP port 12345 and UDP port 12345. **[2] `network.type`:** The value SHOULD be normalized to lowercase. -**[3] `rpc.method`:** This is the logical name of the method from the RPC interface perspective, which can be different from the name of any implementing method/function. The `code.function` attribute may be used to store the latter (e.g., method actually executing the call on the server side, RPC client stub method on the client side). +**[3] `rpc.method`:** This is the logical name of the method from the RPC interface perspective, which can be different from the name of any implementing method/function. The `code.function.name` attribute may be used to store the latter (e.g., method actually executing the call on the server side, RPC client stub method on the client side). **[4] `rpc.service`:** This is the logical name of the service from the RPC interface perspective, which can be different from the name of any implementing class. The `code.namespace` attribute may be used to store the latter (despite the attribute name, it may include a class name; e.g., class with method actually executing the call on the server side, RPC client stub class on the client side). diff --git a/docs/rpc/rpc-spans.md b/docs/rpc/rpc-spans.md index 20928f293e..9401826e9b 100644 --- a/docs/rpc/rpc-spans.md +++ b/docs/rpc/rpc-spans.md @@ -128,7 +128,7 @@ different processes could be listening on TCP port 12345 and UDP port 12345. **[5] `network.type`:** The value SHOULD be normalized to lowercase. -**[6] `rpc.method`:** This is the logical name of the method from the RPC interface perspective, which can be different from the name of any implementing method/function. The `code.function` attribute may be used to store the latter (e.g., method actually executing the call on the server side, RPC client stub method on the client side). +**[6] `rpc.method`:** This is the logical name of the method from the RPC interface perspective, which can be different from the name of any implementing method/function. The `code.function.name` attribute may be used to store the latter (e.g., method actually executing the call on the server side, RPC client stub method on the client side). **[7] `rpc.service`:** This is the logical name of the service from the RPC interface perspective, which can be different from the name of any implementing class. The `code.namespace` attribute may be used to store the latter (despite the attribute name, it may include a class name; e.g., class with method actually executing the call on the server side, RPC client stub class on the client side). @@ -211,7 +211,7 @@ different processes could be listening on TCP port 12345 and UDP port 12345. **[7] `network.type`:** The value SHOULD be normalized to lowercase. -**[8] `rpc.method`:** This is the logical name of the method from the RPC interface perspective, which can be different from the name of any implementing method/function. The `code.function` attribute may be used to store the latter (e.g., method actually executing the call on the server side, RPC client stub method on the client side). +**[8] `rpc.method`:** This is the logical name of the method from the RPC interface perspective, which can be different from the name of any implementing method/function. The `code.function.name` attribute may be used to store the latter (e.g., method actually executing the call on the server side, RPC client stub method on the client side). **[9] `rpc.service`:** This is the logical name of the service from the RPC interface perspective, which can be different from the name of any implementing class. The `code.namespace` attribute may be used to store the latter (despite the attribute name, it may include a class name; e.g., class with method actually executing the call on the server side, RPC client stub class on the client side). diff --git a/docs/runtime/README.md b/docs/runtime/README.md index f04801dd0d..6927e4212e 100644 --- a/docs/runtime/README.md +++ b/docs/runtime/README.md @@ -30,7 +30,7 @@ discussion. Metrics specific to a certain runtime environment should be prefixed with the runtime's top-level namespace `{environment}.*`, e.g., `jvm.*` and follow the -[general metric semantic convention guidelines](/docs/general/metrics.md#general-metric-semantic-conventions). +[general metric semantic convention guidelines](/docs/general/metrics.md#general-guidelines). Authors of runtime instrumentations are responsible for the choice of `{environment}` to avoid ambiguity when interpreting a metric's name or values. @@ -42,7 +42,7 @@ such languages, consider using specific `{environment}` prefixes to avoid ambiguity, like `cpython.*` and `pypy.*`. Also consider the -[general metrics](/docs/general/metrics.md#general-metric-semantic-conventions), +[general metrics](/docs/general/metrics.md#general-guidelines), [system metrics](/docs/system/system-metrics.md) and [OS process metrics](/docs/system/process-metrics.md) semantic conventions when instrumenting runtime environments. diff --git a/docs/system/hardware-metrics.md b/docs/system/hardware-metrics.md index f54c281300..fb5496deb7 100644 --- a/docs/system/hardware-metrics.md +++ b/docs/system/hardware-metrics.md @@ -7,7 +7,7 @@ linkTitle: Hardware **Status**: [Experimental][DocumentStatus] This document describes instruments and attributes for common hardware level -metrics in OpenTelemetry. Consider the [general metric semantic conventions](/docs/general/metrics.md#general-metric-semantic-conventions) +metrics in OpenTelemetry. Consider the [general metric semantic conventions](/docs/general/metrics.md#general-guidelines) when creating instruments not explicitly defined in the specification. This document is being converted to specific hardware metrics, parts of this document that have already been diff --git a/docs/system/process-metrics.md b/docs/system/process-metrics.md index 749f542b2c..01564ce30f 100644 --- a/docs/system/process-metrics.md +++ b/docs/system/process-metrics.md @@ -8,7 +8,7 @@ linkTitle: Process This document describes instruments and attributes for common OS process level metrics in OpenTelemetry. Also consider the [general metric semantic -conventions](/docs/general/metrics.md#general-metric-semantic-conventions) when creating +conventions](/docs/general/metrics.md#general-guidelines) when creating instruments not explicitly defined in this document. OS process metrics are not related to the runtime environment of the program, and should take measurements from the operating system. For runtime environment metrics see diff --git a/docs/system/system-metrics.md b/docs/system/system-metrics.md index 3404b1d54d..6194ae0e72 100644 --- a/docs/system/system-metrics.md +++ b/docs/system/system-metrics.md @@ -8,7 +8,7 @@ linkTitle: System This document describes instruments and attributes for common system level metrics in OpenTelemetry. Consider the [general metric semantic -conventions](/docs/general/metrics.md#general-metric-semantic-conventions) when creating +conventions](/docs/general/metrics.md#general-guidelines) when creating instruments not explicitly defined in the specification. The `system.*` namespace SHOULD be exclusively used to report hosts' metrics. diff --git a/gulpfile.js b/gulpfile.js deleted file mode 100644 index b01927ecc0..0000000000 --- a/gulpfile.js +++ /dev/null @@ -1,64 +0,0 @@ -const gulp = require("gulp"); -const through2 = require("through2"); -const markdownlint = require("markdownlint"); -const yaml = require("js-yaml"); -const fs = require("fs"); - -let numFilesProcessed = 0, - numFilesWithIssues = 0; - -function markdownLintFile(file, encoding, callback) { - const config = yaml.load(fs.readFileSync("./.markdownlint.yaml", "utf8")); - const options = { - files: [file.path], - config: config, - }; - - markdownlint(options, function (err, result) { - if (err) { - console.error("ERROR occurred while running markdownlint: ", err); - return callback(err); - } - - const _resultString = (result || "").toString(); - // Result is a string with lines of the form: - // - // :\s*: - // - // Strip out any whitespace between the filepath and line number - // so that tools can jump directly to the line. - const resultString = _resultString - .split("\n") - .map((line) => line.replace(/^([^:]+):\s*(\d+):(.*)/, "$1:$2:$3")) - .join("\n"); - if (resultString) { - console.log(resultString); - numFilesWithIssues++; - // Don't report an error yet so that other files can be checked: - // callback(new Error('...')); - } - numFilesProcessed++; - callback(null, file); - }); -} - -function lintMarkdown() { - const markdownFiles = ["**/*.md", "!**/node_modules/**", "!**/.github/**"]; - - return gulp - .src(markdownFiles) - .pipe(through2.obj(markdownLintFile)) - .on("end", () => { - const fileOrFiles = "file" + (numFilesProcessed == 1 ? "" : "s"); - const msg = `Processed ${numFilesProcessed} ${fileOrFiles}, ${numFilesWithIssues} had issues.`; - if (numFilesWithIssues > 0) { - throw new Error(msg); - } else { - console.log(msg); - } - }); -} - -lintMarkdown.description = `Run markdownlint on all '*.md' files.`; - -gulp.task("lint-md", lintMarkdown); diff --git a/model/code/common.yaml b/model/code/common.yaml index b90efeec96..f455943005 100644 --- a/model/code/common.yaml +++ b/model/code/common.yaml @@ -2,12 +2,12 @@ groups: - id: code type: attribute_group brief: > - These attributes allow to report this unit of code and therefore to provide more context about the span. + These attributes provide context about source code attributes: - - ref: code.function + - ref: code.function.name - ref: code.namespace - ref: code.filepath - - ref: code.lineno - - ref: code.column + - ref: code.line.number + - ref: code.column.number - ref: code.stacktrace requirement_level: opt_in diff --git a/model/code/registry-deprecated.yaml b/model/code/registry-deprecated.yaml new file mode 100644 index 0000000000..16daea5c4c --- /dev/null +++ b/model/code/registry-deprecated.yaml @@ -0,0 +1,34 @@ +groups: + - id: registry.code.deprecated + type: attribute_group + display_name: Deprecated Code Attributes + brief: > + These deprecated attributes provide context about source code + attributes: + - id: code.function + type: string + stability: experimental + deprecated: Replaced by `code.function.name` + brief: > + Deprecated, use `code.function.name` instead + examples: serveRequest + - id: code.filepath + type: string + stability: experimental + brief: > + Deprecated, use `code.file.path` instead + examples: /usr/local/MyApplication/content_root/app/index.php + - id: code.lineno + type: int + stability: experimental + deprecated: Replaced by `code.line.number` + brief: > + Deprecated, use `code.line.number` instead + examples: 42 + - id: code.column + type: int + stability: experimental + deprecated: Replaced by `code.column.number` + brief: > + Deprecated, use `code.column.number` + examples: 16 diff --git a/model/code/registry.yaml b/model/code/registry.yaml index 15621a94df..c2946523a3 100644 --- a/model/code/registry.yaml +++ b/model/code/registry.yaml @@ -3,9 +3,9 @@ groups: type: attribute_group display_name: Code Attributes brief: > - These attributes allow to report this unit of code and therefore to provide more context about the span. + These attributes provide context about source code attributes: - - id: code.function + - id: code.function.name type: string stability: experimental brief: > @@ -15,26 +15,26 @@ groups: type: string stability: experimental brief: > - The "namespace" within which `code.function` is defined. Usually the qualified class or module name, - such that `code.namespace` + some separator + `code.function` form a unique identifier for the code unit. + The "namespace" within which `code.function.name` is defined. Usually the qualified class or module name, + such that `code.namespace` + some separator + `code.function.name` form a unique identifier for the code unit. examples: com.example.MyHttpService - - id: code.filepath + - id: code.file.path type: string stability: experimental brief: > The source code file name that identifies the code unit as uniquely as possible (preferably an absolute file path). examples: /usr/local/MyApplication/content_root/app/index.php - - id: code.lineno + - id: code.line.number type: int stability: experimental brief: > - The line number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`. + The line number in `code.file.path` best representing the operation. It SHOULD point within the code unit named in `code.function.name`. examples: 42 - - id: code.column + - id: code.column.number type: int stability: experimental brief: > - The column number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`. + The column number in `code.file.path` best representing the operation. It SHOULD point within the code unit named in `code.function.name`. examples: 16 - id: code.stacktrace type: string diff --git a/model/faas/registry.yaml b/model/faas/registry.yaml index 89691eac06..b6fea47442 100644 --- a/model/faas/registry.yaml +++ b/model/faas/registry.yaml @@ -13,7 +13,7 @@ groups: This is the name of the function as configured/deployed on the FaaS platform and is usually different from the name of the callback function (which may be stored in the - [`code.namespace`/`code.function`](/docs/general/attributes.md#source-code-attributes) + [`code.namespace`/`code.function.name`](/docs/general/attributes.md#source-code-attributes) span attributes). For some cloud providers, the above definition is ambiguous. The following diff --git a/model/gen-ai/registry.yaml b/model/gen-ai/registry.yaml index ddf79f91ed..09c36698e4 100644 --- a/model/gen-ai/registry.yaml +++ b/model/gen-ai/registry.yaml @@ -17,6 +17,10 @@ groups: stability: experimental value: "vertex_ai" brief: 'Vertex AI' + - id: gemini + stability: experimental + value: "gemini" + brief: 'Gemini' - id: anthropic stability: experimental value: "anthropic" @@ -29,6 +33,10 @@ groups: stability: experimental value: "az.ai.inference" brief: 'Azure AI Inference' + - id: az.ai.openai + stability: experimental + value: "az.ai.openai" + brief: 'Azure OpenAI' - id: ibm.watsonx.ai stability: experimental value: "ibm.watsonx.ai" @@ -37,14 +45,33 @@ groups: stability: experimental value: "aws.bedrock" brief: 'AWS Bedrock' + - id: perplexity + stability: experimental + value: "perplexity" + brief: 'Perplexity' + - id: xai + stability: experimental + value: "xai" + brief: 'xAI' + - id: deepseek + stability: experimental + value: "deepseek" + brief: 'DeepSeek' + - id: groq + stability: experimental + value: "groq" + brief: 'Groq' + brief: The Generative AI product as identified by the client or server instrumentation. note: | The `gen_ai.system` describes a family of GenAI models with specific model identified by `gen_ai.request.model` and `gen_ai.response.model` attributes. The actual GenAI product may differ from the one identified by the client. - For example, when using OpenAI client libraries to communicate with Mistral, the `gen_ai.system` - is set to `openai` based on the instrumentation's best knowledge. + Multiple systems, including Azure OpenAI and Gemini, are accessible by OpenAI client + libraries. In such cases, the `gen_ai.system` is set to `openai` based on the + instrumentation's best knowledge, instead of the actual system. The `server.address` + attribute may help identify the actual system in use for `openai`. For custom model, a custom friendly name SHOULD be used. If none of these options apply, the `gen_ai.system` SHOULD be set to `_OTHER`. diff --git a/model/gen-ai/spans.yaml b/model/gen-ai/spans.yaml index e6a3c743be..1d1311d9a1 100644 --- a/model/gen-ai/spans.yaml +++ b/model/gen-ai/spans.yaml @@ -26,6 +26,9 @@ groups: requirement_level: recommended - ref: gen_ai.request.presence_penalty requirement_level: recommended + - ref: gen_ai.request.seed + requirement_level: + conditionally_required: if appliable and if the request includes a seed - ref: gen_ai.request.encoding_formats requirement_level: recommended - ref: gen_ai.response.id @@ -82,9 +85,6 @@ groups: attributes: - ref: gen_ai.request.model requirement_level: required - - ref: gen_ai.openai.request.seed - requirement_level: - conditionally_required: if the request includes a seed - ref: gen_ai.openai.request.response_format requirement_level: conditionally_required: if the request includes a response_format diff --git a/model/rpc/registry.yaml b/model/rpc/registry.yaml index a94c3b2534..aeec3a5979 100644 --- a/model/rpc/registry.yaml +++ b/model/rpc/registry.yaml @@ -197,7 +197,7 @@ groups: note: > This is the logical name of the method from the RPC interface perspective, which can be different from the name of any implementing method/function. - The `code.function` attribute may be used to store the latter + The `code.function.name` attribute may be used to store the latter (e.g., method actually executing the call on the server side, RPC client stub method on the client side). examples: "exampleMethod" diff --git a/package.json b/package.json index ef069a000a..6e32c045d4 100644 --- a/package.json +++ b/package.json @@ -9,14 +9,10 @@ "test": "npm run check" }, "devDependencies": { - "gulp": "^5.0.0", - "js-yaml": "^4.1.0", "markdown-link-check": "3.11.2", "markdown-toc": "^1.2.0", - "markdownlint": "0.36.1", "markdownlint-cli": "0.43.0", - "prettier": "^3.0.0", - "through2": "^4.0.2" + "prettier": "^3.0.0" }, "prettier": { "proseWrap": "preserve" diff --git a/policies/group_stability.rego b/policies/group_stability.rego index 17d7f3dd91..62eb061bb9 100644 --- a/policies/group_stability.rego +++ b/policies/group_stability.rego @@ -1,7 +1,7 @@ package after_resolution - +import rego.v1 # checks that stable group does not have experimental attributes with requirement levels other than opt_in -deny[group_stability_violation(description, group.id, name)] { +deny contains group_stability_violation(description, group.id, name) if { group := input.groups[_] # ignore attribute_groups group.type != "attribute_group" @@ -27,7 +27,7 @@ deny[group_stability_violation(description, group.id, name)] { description := sprintf("Stable group '%s' references experimental attribute with requirement level '%s', only 'opt_in' level is allowed", [group.id, name]) } -group_stability_violation(description, group, attr) = violation { +group_stability_violation(description, group, attr) = violation if { violation := { "id": description, "type": "semconv_attribute", diff --git a/policies/registry.rego b/policies/registry.rego index fccafd9b79..3e145c1afa 100644 --- a/policies/registry.rego +++ b/policies/registry.rego @@ -1,11 +1,12 @@ package before_resolution +import rego.v1 # This file enforces policies requiring all attributes to be defined within # a semantic convention "registry". This is a naming/structure convention # used by semantic conventions. # Helper to create attribute registry violations. -attr_registry_violation(description, group_id, attr_id) = violation { +attr_registry_violation(description, group_id, attr_id) = violation if { violation := { "id": description, "type": "semconv_attribute", @@ -16,7 +17,7 @@ attr_registry_violation(description, group_id, attr_id) = violation { } # We only allow attribute groups in the attribute registry. -deny[attr_registry_violation(description, group.id, "")] { +deny contains attr_registry_violation(description, group.id, "") if { group := input.groups[_] startswith(group.id, "registry.") group.type != "attribute_group" @@ -28,7 +29,7 @@ deny[attr_registry_violation(description, group.id, "")] { # Any group that is NOT in the attribute registry that has an attribute id is # in violation of not using the attribute registry. -deny[attr_registry_violation(description, group.id, attr.id)] { +deny contains attr_registry_violation(description, group.id, attr.id) if { group := input.groups[_] not startswith(group.id, "registry.") attr := group.attributes[_] @@ -43,7 +44,7 @@ deny[attr_registry_violation(description, group.id, attr.id)] { # A registry `attribute_group` containing at least one `ref` attribute is # considered invalid if it's not in the registry group. -deny[attr_registry_violation(description, group.id, attr.ref)] { +deny contains attr_registry_violation(description, group.id, attr.ref) if { # TODO - this will need to be updated to support `embed` in the future. group := input.groups[_] startswith(group.id, "registry.") @@ -56,7 +57,7 @@ deny[attr_registry_violation(description, group.id, attr.ref)] { } # We don't allow attribute definitions to have requirement_level -deny[attr_registry_violation(description, group.id, attr.id)] { +deny contains attr_registry_violation(description, group.id, attr.id) if { group := input.groups[_] startswith(group.id, "registry.") @@ -69,8 +70,8 @@ deny[attr_registry_violation(description, group.id, attr.id)] { description := sprintf("Attribute definition '%s' has requirement_level set to %s. Only attribute references can set requirement_level.", [attr.id, attr.requirement_level]) } -get_attribute_name(attr, group) = name { - full_name = concat(".", [group.prefix, attr.id]) +get_attribute_name(attr, group) := name if { + full_name := concat(".", [group.prefix, attr.id]) # if there was no prefix, we have a leading dot name := trim(full_name, ".") diff --git a/policies/yaml_schema.rego b/policies/yaml_schema.rego index d8d60471f0..a2575930bc 100644 --- a/policies/yaml_schema.rego +++ b/policies/yaml_schema.rego @@ -1,7 +1,8 @@ package before_resolution +import rego.v1 # checks attribute name format -deny[yaml_schema_violation(description, group.id, name)] { +deny contains yaml_schema_violation(description, group.id, name) if { group := input.groups[_] attr := group.attributes[_] name := attr.id @@ -12,7 +13,7 @@ deny[yaml_schema_violation(description, group.id, name)] { } # checks attribute name has a namespace -deny[yaml_schema_violation(description, group.id, name)] { +deny contains yaml_schema_violation(description, group.id, name) if { group := input.groups[_] attr := group.attributes[_] name := attr.id @@ -24,9 +25,8 @@ deny[yaml_schema_violation(description, group.id, name)] { description := sprintf("Attribute name '%s' should have a namespace. Attribute name %s", [name, invalid_name_helper]) } - # checks metric name format -deny[yaml_schema_violation(description, group.id, name)] { +deny contains yaml_schema_violation(description, group.id, name) if { group := input.groups[_] name := group.metric_name @@ -37,7 +37,7 @@ deny[yaml_schema_violation(description, group.id, name)] { } # checks that metric id matches metric.{metric_name} -deny[yaml_schema_violation(description, group.id, name)] { +deny contains yaml_schema_violation(description, group.id, name) if { group := input.groups[_] name := group.metric_name name != null @@ -49,7 +49,7 @@ deny[yaml_schema_violation(description, group.id, name)] { } # checks event name format -deny[yaml_schema_violation(description, group.id, name)] { +deny contains yaml_schema_violation(description, group.id, name) if { group := input.groups[_] group.type == "event" name := group.name @@ -61,7 +61,7 @@ deny[yaml_schema_violation(description, group.id, name)] { } # checks that event id matches event.{name} -deny[yaml_schema_violation(description, group.id, name)] { +deny contains yaml_schema_violation(description, group.id, name) if { group := input.groups[_] group.type == "event" name := group.name @@ -73,7 +73,7 @@ deny[yaml_schema_violation(description, group.id, name)] { } # checks event.name is not referenced in event attributes -deny[yaml_schema_violation(description, group.id, name)] { +deny contains yaml_schema_violation(description, group.id, name) if { group := input.groups[_] group.type == "event" name := group.name @@ -85,7 +85,7 @@ deny[yaml_schema_violation(description, group.id, name)] { } # require resources have names -deny[yaml_schema_violation(description, group.id, "")] { +deny contains yaml_schema_violation(description, group.id, "") if { group := input.groups[_] group.type == "resource" group.name == null @@ -93,7 +93,7 @@ deny[yaml_schema_violation(description, group.id, "")] { } # checks resource name format -deny[yaml_schema_violation(description, group.id, name)] { +deny contains yaml_schema_violation(description, group.id, name) if { group := input.groups[_] group.type == "resource" name := group.name @@ -105,7 +105,7 @@ deny[yaml_schema_violation(description, group.id, name)] { } # checks that resource group id matches resource.{name} -deny[yaml_schema_violation(description, group.id, name)] { +deny contains yaml_schema_violation(description, group.id, name) if { group := input.groups[_] group.type == "resource" @@ -122,7 +122,7 @@ deny[yaml_schema_violation(description, group.id, name)] { } # checks attribute member id format -deny[yaml_schema_violation(description, group.id, attr_name)] { +deny contains yaml_schema_violation(description, group.id, attr_name) if { group := input.groups[_] attr := group.attributes[_] attr_name := attr.id @@ -134,7 +134,7 @@ deny[yaml_schema_violation(description, group.id, attr_name)] { } # check that attribute is fully qualified with their id, prefix is no longer supported -deny[yaml_schema_violation(description, group.id, "")] { +deny contains yaml_schema_violation(description, group.id, "") if { group := input.groups[_] group.prefix != null @@ -146,7 +146,7 @@ deny[yaml_schema_violation(description, group.id, "")] { # TODO: remove after span_kind is required https://github.com/open-telemetry/semantic-conventions/issues/1513 # checks that span id matches span.*. pattern if span_kind is not provided -deny[yaml_schema_violation(description, group.id, "")] { +deny contains yaml_schema_violation(description, group.id, "") if { group := input.groups[_] group.type == "span" kind := group.span_kind @@ -157,7 +157,7 @@ deny[yaml_schema_violation(description, group.id, "")] { } # checks that span id matches span.*.{kind} pattern if span_kind is not provided -deny[yaml_schema_violation(description, group.id, "")] { +deny contains yaml_schema_violation(description, group.id, "") if { group := input.groups[_] group.type == "span" kind := group.span_kind @@ -168,7 +168,7 @@ deny[yaml_schema_violation(description, group.id, "")] { description := sprintf("Group id '%s' is invalid. Span group 'id' must follow 'span.*.%s' pattern", [group.id, kind]) } -yaml_schema_violation(description, group, attr) = violation { +yaml_schema_violation(description, group, attr) = violation if { violation := { "id": description, "type": "semconv_attribute", diff --git a/policies_test/yaml_schema_test.rego b/policies_test/yaml_schema_test.rego index 6c5cb4cc89..81dd0f2d55 100644 --- a/policies_test/yaml_schema_test.rego +++ b/policies_test/yaml_schema_test.rego @@ -100,21 +100,21 @@ test_fails_on_invalid_resource_id if { } } -create_attribute_group(attr) = json { +create_attribute_group(attr) = json if { json := [{"id": "yaml_schema.test", "attributes": [{"id": attr}]}] } -create_metric(name) = json { +create_metric(name) = json if { id := sprintf("metric.%s", [name]) json := [{"id": id, "type": "metric", "metric_name": name}] } -create_event(name) = json { +create_event(name) = json if { id := sprintf("event.%s", [name]) json := [{"id": id, "type": "event", "name": name}] } -create_resource(name) = json { +create_resource(name) = json if { id := sprintf("resource.%s", [name]) json := [{"id": id, "type": "resource", "name": name}] } diff --git a/schema-next.yaml b/schema-next.yaml index 1a429b3724..8ebce284ac 100644 --- a/schema-next.yaml +++ b/schema-next.yaml @@ -7,7 +7,15 @@ versions: # https://github.com/open-telemetry/semantic-conventions/pull/1632 - rename_attributes: attribute_map: + gen_ai.openai.request.seed: gen_ai.request.seed system.network.state: network.connection.state + # https://github.com/open-telemetry/semantic-conventions/pull/1624 + - rename_attributes: + attribute_map: + code.function: code.function.name + code.filepath: code.file.path + code.lineno: code.line.number + code.column: code.column.number 1.29.0: all: changes: