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/.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/Makefile b/Makefile index 813a09c639..644a633870 100644 --- a/Makefile +++ b/Makefile @@ -101,17 +101,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/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/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/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/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/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..49ec864f23 100644 --- a/schema-next.yaml +++ b/schema-next.yaml @@ -7,6 +7,7 @@ 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 1.29.0: all: