From 80a63178b2785be9d152620d5b94d3d20de8556f Mon Sep 17 00:00:00 2001 From: Robert Pajak Date: Mon, 7 Jul 2025 13:49:31 +0200 Subject: [PATCH 01/12] add more otel.scope attrs to non-OTLP exporters --- model/otel/registry.yaml | 11 +++++++++++ model/otel/resources.yaml | 4 ++++ 2 files changed, 15 insertions(+) diff --git a/model/otel/registry.yaml b/model/otel/registry.yaml index f6dc2ad6a3..201e789cf6 100644 --- a/model/otel/registry.yaml +++ b/model/otel/registry.yaml @@ -54,6 +54,17 @@ groups: brief: The version of the instrumentation scope - (`InstrumentationScope.Version` in OTLP). examples: ['1.0.0'] stability: stable + - id: otel.scope.schema_url + type: string + brief: The schema URL of the instrumentation scope - (`InstrumentationScope.SchemaUrl` in OTLP). + examples: ['https://opentelemetry.io/schemas/1.31.0'] + stability: stable + - id: otel.scope + type: template[string[]] + brief: > + The attributes of the instrumentation scope - (`InstrumentationScope.Attributes` in OTLP). + examples: ['otel.scope.attributes.foo="bar"', 'otel.scope.baz="qux"'] + stability: stable - id: registry.otel.component type: attribute_group display_name: OTel Component Attributes diff --git a/model/otel/resources.yaml b/model/otel/resources.yaml index ba78711b41..12c182eb94 100644 --- a/model/otel/resources.yaml +++ b/model/otel/resources.yaml @@ -10,3 +10,7 @@ groups: requirement_level: recommended - ref: otel.scope.version requirement_level: recommended + - ref: otel.scope.schema_url + requirement_level: recommended + - ref: otel.scope + requirement_level: recommended From fb9388fc0bd0a1f5bafbbef0517fd92f50b0ac9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Paj=C4=85k?= Date: Mon, 7 Jul 2025 13:55:20 +0200 Subject: [PATCH 02/12] Update registry.yaml --- model/otel/registry.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model/otel/registry.yaml b/model/otel/registry.yaml index d4a09632ed..a9b92e9a6d 100644 --- a/model/otel/registry.yaml +++ b/model/otel/registry.yaml @@ -73,7 +73,7 @@ groups: stability: stable - id: otel.scope.schema_url type: string - brief: The schema URL of the instrumentation scope - (`InstrumentationScope.SchemaUrl` in OTLP). + brief: The schema URL of the instrumentation scope. examples: ['https://opentelemetry.io/schemas/1.31.0'] stability: stable - id: otel.scope From 6425dfd7899b2303bdd3c4af654e120de88d96c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Paj=C4=85k?= Date: Mon, 7 Jul 2025 12:05:07 +0000 Subject: [PATCH 03/12] Fix templated attr --- model/otel/registry.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/model/otel/registry.yaml b/model/otel/registry.yaml index a9b92e9a6d..dd56b733b1 100644 --- a/model/otel/registry.yaml +++ b/model/otel/registry.yaml @@ -77,10 +77,10 @@ groups: examples: ['https://opentelemetry.io/schemas/1.31.0'] stability: stable - id: otel.scope - type: template[string[]] + type: template[string] brief: > The attributes of the instrumentation scope - (`InstrumentationScope.Attributes` in OTLP). - examples: ['otel.scope.attributes.foo="bar"', 'otel.scope.baz="qux"'] + examples: ["someval", "55"] stability: stable - id: registry.otel.component type: attribute_group From 8446dee5279710a979b45a84606ab14b0190d394 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Paj=C4=85k?= Date: Mon, 7 Jul 2025 12:45:40 +0000 Subject: [PATCH 04/12] generate --- docs/registry/attributes/otel.md | 2 ++ docs/registry/entities/otel.md | 2 ++ 2 files changed, 4 insertions(+) diff --git a/docs/registry/attributes/otel.md b/docs/registry/attributes/otel.md index cf9ec65e71..5ed7986105 100644 --- a/docs/registry/attributes/otel.md +++ b/docs/registry/attributes/otel.md @@ -103,7 +103,9 @@ Attributes used by non-OTLP exporters to represent OpenTelemetry Scope's concept | Attribute | Type | Description | Examples | Stability | |---|---|---|---|---| +| `otel.scope.` | string | The attributes of the instrumentation scope - (`InstrumentationScope.Attributes` in OTLP). | `someval`; `55` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | `otel.scope.name` | string | The name of the instrumentation scope - (`InstrumentationScope.Name` in OTLP). | `io.opentelemetry.contrib.mongodb` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| `otel.scope.schema_url` | string | The schema URL of the instrumentation scope. | `https://opentelemetry.io/schemas/1.31.0` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | `otel.scope.version` | string | The version of the instrumentation scope - (`InstrumentationScope.Version` in OTLP). | `1.0.0` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | ## Deprecated OTel Library Attributes diff --git a/docs/registry/entities/otel.md b/docs/registry/entities/otel.md index dd980aec58..8bdc86818d 100644 --- a/docs/registry/entities/otel.md +++ b/docs/registry/entities/otel.md @@ -20,7 +20,9 @@ | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| +| [`otel.scope.`](/docs/registry/attributes/otel.md) | string | The attributes of the instrumentation scope - (`InstrumentationScope.Attributes` in OTLP). | `someval`; `55` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | [`otel.scope.name`](/docs/registry/attributes/otel.md) | string | The name of the instrumentation scope - (`InstrumentationScope.Name` in OTLP). | `io.opentelemetry.contrib.mongodb` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`otel.scope.schema_url`](/docs/registry/attributes/otel.md) | string | The schema URL of the instrumentation scope. | `https://opentelemetry.io/schemas/1.31.0` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | [`otel.scope.version`](/docs/registry/attributes/otel.md) | string | The version of the instrumentation scope - (`InstrumentationScope.Version` in OTLP). | `1.0.0` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | From a8e4cfe6f6b6181c0bec95f40eaaab904e1b2d46 Mon Sep 17 00:00:00 2001 From: Robert Pajak Date: Tue, 8 Jul 2025 15:24:43 +0200 Subject: [PATCH 05/12] Refine registry.yaml --- model/otel/registry.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/model/otel/registry.yaml b/model/otel/registry.yaml index dd56b733b1..3006b5f377 100644 --- a/model/otel/registry.yaml +++ b/model/otel/registry.yaml @@ -80,8 +80,13 @@ groups: type: template[string] brief: > The attributes of the instrumentation scope - (`InstrumentationScope.Attributes` in OTLP). + `` being the instrumentation scope attribute key, + the value being the instrumentation scope attribute value. + note: > + For example, an instrumentation scope attribute `foo` with value `12` SHOULD be recorded + as the `otel.scope.foo` attribute with value `12`. examples: ["someval", "55"] - stability: stable + stability: development - id: registry.otel.component type: attribute_group display_name: OTel Component Attributes From 3b73ce7b93ee59e07cdb486c5a5390a686cd9cec Mon Sep 17 00:00:00 2001 From: Robert Pajak Date: Tue, 8 Jul 2025 15:25:35 +0200 Subject: [PATCH 06/12] Update docs --- docs/registry/attributes/otel.md | 4 +++- docs/registry/entities/otel.md | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/registry/attributes/otel.md b/docs/registry/attributes/otel.md index 5ed7986105..b49b03f9dc 100644 --- a/docs/registry/attributes/otel.md +++ b/docs/registry/attributes/otel.md @@ -103,11 +103,13 @@ Attributes used by non-OTLP exporters to represent OpenTelemetry Scope's concept | Attribute | Type | Description | Examples | Stability | |---|---|---|---|---| -| `otel.scope.` | string | The attributes of the instrumentation scope - (`InstrumentationScope.Attributes` in OTLP). | `someval`; `55` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| `otel.scope.` | string | The attributes of the instrumentation scope - (`InstrumentationScope.Attributes` in OTLP). `` being the instrumentation scope attribute key, the value being the instrumentation scope attribute value. [3] | `someval`; `55` | ![Development](https://img.shields.io/badge/-development-blue) | | `otel.scope.name` | string | The name of the instrumentation scope - (`InstrumentationScope.Name` in OTLP). | `io.opentelemetry.contrib.mongodb` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | `otel.scope.schema_url` | string | The schema URL of the instrumentation scope. | `https://opentelemetry.io/schemas/1.31.0` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | `otel.scope.version` | string | The version of the instrumentation scope - (`InstrumentationScope.Version` in OTLP). | `1.0.0` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +**[3] `otel.scope.`:** For example, an instrumentation scope attribute `foo` with value `12` SHOULD be recorded as the `otel.scope.foo` attribute with value `12`. + ## Deprecated OTel Library Attributes Describes deprecated otel.library attributes. diff --git a/docs/registry/entities/otel.md b/docs/registry/entities/otel.md index 8bdc86818d..486d69f66d 100644 --- a/docs/registry/entities/otel.md +++ b/docs/registry/entities/otel.md @@ -20,10 +20,12 @@ | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| -| [`otel.scope.`](/docs/registry/attributes/otel.md) | string | The attributes of the instrumentation scope - (`InstrumentationScope.Attributes` in OTLP). | `someval`; `55` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| [`otel.scope.`](/docs/registry/attributes/otel.md) | string | The attributes of the instrumentation scope - (`InstrumentationScope.Attributes` in OTLP). `` being the instrumentation scope attribute key, the value being the instrumentation scope attribute value. [1] | `someval`; `55` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) | | [`otel.scope.name`](/docs/registry/attributes/otel.md) | string | The name of the instrumentation scope - (`InstrumentationScope.Name` in OTLP). | `io.opentelemetry.contrib.mongodb` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | [`otel.scope.schema_url`](/docs/registry/attributes/otel.md) | string | The schema URL of the instrumentation scope. | `https://opentelemetry.io/schemas/1.31.0` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | [`otel.scope.version`](/docs/registry/attributes/otel.md) | string | The version of the instrumentation scope - (`InstrumentationScope.Version` in OTLP). | `1.0.0` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +**[1] `otel.scope.`:** For example, an instrumentation scope attribute `foo` with value `12` SHOULD be recorded as the `otel.scope.foo` attribute with value `12`. + From 84a6527ee94ef029f523f39506589ab168d56f3a Mon Sep 17 00:00:00 2001 From: Robert Pajak Date: Tue, 8 Jul 2025 15:28:43 +0200 Subject: [PATCH 07/12] policy: ignore otel.scope attribute --- policies/attribute_name_collisions.rego | 3 +++ 1 file changed, 3 insertions(+) diff --git a/policies/attribute_name_collisions.rego b/policies/attribute_name_collisions.rego index 374be5ca07..031da0d1fd 100644 --- a/policies/attribute_name_collisions.rego +++ b/policies/attribute_name_collisions.rego @@ -41,6 +41,9 @@ deny contains attr_registry_collision(description, name) if { name := attribute_names[i].name prefix := attribute_names[i].namespace_prefix + # ignore otel.scope attribute + name != "otel.scope" + collisions := [other.name | other := attribute_names[_] not other.deprecated From d46b003c44717785a3a3ef41d3d6296d03e748c1 Mon Sep 17 00:00:00 2001 From: Robert Pajak Date: Tue, 8 Jul 2025 15:35:51 +0200 Subject: [PATCH 08/12] Add chanagelog entry --- .chloggen/2489.yaml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .chloggen/2489.yaml diff --git a/.chloggen/2489.yaml b/.chloggen/2489.yaml new file mode 100644 index 0000000000..2608762d0a --- /dev/null +++ b/.chloggen/2489.yaml @@ -0,0 +1,17 @@ +# 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: otel + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: "Add `otel.scope.` attribute to non-OTLP exporters that represents an instrumentation scope attribute." + +# 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: [2320, 2489] From dad5f064374576349c2cf379a645d3ed7edda249 Mon Sep 17 00:00:00 2001 From: Robert Pajak Date: Tue, 8 Jul 2025 16:15:38 +0200 Subject: [PATCH 09/12] Remove from deprecated signal --- docs/registry/entities/otel.md | 4 ---- model/otel/deprecated/entities-deprecated.yaml | 4 ---- 2 files changed, 8 deletions(-) diff --git a/docs/registry/entities/otel.md b/docs/registry/entities/otel.md index 486d69f66d..dd980aec58 100644 --- a/docs/registry/entities/otel.md +++ b/docs/registry/entities/otel.md @@ -20,12 +20,8 @@ | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| -| [`otel.scope.`](/docs/registry/attributes/otel.md) | string | The attributes of the instrumentation scope - (`InstrumentationScope.Attributes` in OTLP). `` being the instrumentation scope attribute key, the value being the instrumentation scope attribute value. [1] | `someval`; `55` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) | | [`otel.scope.name`](/docs/registry/attributes/otel.md) | string | The name of the instrumentation scope - (`InstrumentationScope.Name` in OTLP). | `io.opentelemetry.contrib.mongodb` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | -| [`otel.scope.schema_url`](/docs/registry/attributes/otel.md) | string | The schema URL of the instrumentation scope. | `https://opentelemetry.io/schemas/1.31.0` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | [`otel.scope.version`](/docs/registry/attributes/otel.md) | string | The version of the instrumentation scope - (`InstrumentationScope.Version` in OTLP). | `1.0.0` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | -**[1] `otel.scope.`:** For example, an instrumentation scope attribute `foo` with value `12` SHOULD be recorded as the `otel.scope.foo` attribute with value `12`. - diff --git a/model/otel/deprecated/entities-deprecated.yaml b/model/otel/deprecated/entities-deprecated.yaml index 7409a1654b..8253b81a10 100644 --- a/model/otel/deprecated/entities-deprecated.yaml +++ b/model/otel/deprecated/entities-deprecated.yaml @@ -12,7 +12,3 @@ groups: requirement_level: recommended - ref: otel.scope.version requirement_level: recommended - - ref: otel.scope.schema_url - requirement_level: recommended - - ref: otel.scope - requirement_level: recommended From bdd6fc1f1190a62123392770f0b640311faa1d0c Mon Sep 17 00:00:00 2001 From: Robert Pajak Date: Tue, 8 Jul 2025 20:56:30 +0200 Subject: [PATCH 10/12] Remove otel.scope attributes --- .chloggen/2489.yaml | 2 +- docs/registry/attributes/otel.md | 3 --- model/otel/registry.yaml | 11 ----------- policies/attribute_name_collisions.rego | 3 --- 4 files changed, 1 insertion(+), 18 deletions(-) diff --git a/.chloggen/2489.yaml b/.chloggen/2489.yaml index 2608762d0a..316613ea72 100644 --- a/.chloggen/2489.yaml +++ b/.chloggen/2489.yaml @@ -10,7 +10,7 @@ change_type: enhancement component: otel # A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). -note: "Add `otel.scope.` attribute to non-OTLP exporters that represents an instrumentation scope attribute." +note: "Add `otel.scope.schema_url` attribute to non-OTLP exporters that represents an instrumentation scope schema URL." # 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. diff --git a/docs/registry/attributes/otel.md b/docs/registry/attributes/otel.md index b49b03f9dc..83062892e3 100644 --- a/docs/registry/attributes/otel.md +++ b/docs/registry/attributes/otel.md @@ -103,13 +103,10 @@ Attributes used by non-OTLP exporters to represent OpenTelemetry Scope's concept | Attribute | Type | Description | Examples | Stability | |---|---|---|---|---| -| `otel.scope.` | string | The attributes of the instrumentation scope - (`InstrumentationScope.Attributes` in OTLP). `` being the instrumentation scope attribute key, the value being the instrumentation scope attribute value. [3] | `someval`; `55` | ![Development](https://img.shields.io/badge/-development-blue) | | `otel.scope.name` | string | The name of the instrumentation scope - (`InstrumentationScope.Name` in OTLP). | `io.opentelemetry.contrib.mongodb` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | `otel.scope.schema_url` | string | The schema URL of the instrumentation scope. | `https://opentelemetry.io/schemas/1.31.0` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | | `otel.scope.version` | string | The version of the instrumentation scope - (`InstrumentationScope.Version` in OTLP). | `1.0.0` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | -**[3] `otel.scope.`:** For example, an instrumentation scope attribute `foo` with value `12` SHOULD be recorded as the `otel.scope.foo` attribute with value `12`. - ## Deprecated OTel Library Attributes Describes deprecated otel.library attributes. diff --git a/model/otel/registry.yaml b/model/otel/registry.yaml index 3006b5f377..c95ebb492e 100644 --- a/model/otel/registry.yaml +++ b/model/otel/registry.yaml @@ -76,17 +76,6 @@ groups: brief: The schema URL of the instrumentation scope. examples: ['https://opentelemetry.io/schemas/1.31.0'] stability: stable - - id: otel.scope - type: template[string] - brief: > - The attributes of the instrumentation scope - (`InstrumentationScope.Attributes` in OTLP). - `` being the instrumentation scope attribute key, - the value being the instrumentation scope attribute value. - note: > - For example, an instrumentation scope attribute `foo` with value `12` SHOULD be recorded - as the `otel.scope.foo` attribute with value `12`. - examples: ["someval", "55"] - stability: development - id: registry.otel.component type: attribute_group display_name: OTel Component Attributes diff --git a/policies/attribute_name_collisions.rego b/policies/attribute_name_collisions.rego index 031da0d1fd..374be5ca07 100644 --- a/policies/attribute_name_collisions.rego +++ b/policies/attribute_name_collisions.rego @@ -41,9 +41,6 @@ deny contains attr_registry_collision(description, name) if { name := attribute_names[i].name prefix := attribute_names[i].namespace_prefix - # ignore otel.scope attribute - name != "otel.scope" - collisions := [other.name | other := attribute_names[_] not other.deprecated From ee4ac9bb4b19b172aa88b0d04e739136fdcdd000 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Paj=C4=85k?= Date: Tue, 15 Jul 2025 13:27:02 +0200 Subject: [PATCH 11/12] Update model/otel/registry.yaml --- model/otel/registry.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model/otel/registry.yaml b/model/otel/registry.yaml index c95ebb492e..916df907b0 100644 --- a/model/otel/registry.yaml +++ b/model/otel/registry.yaml @@ -75,7 +75,7 @@ groups: type: string brief: The schema URL of the instrumentation scope. examples: ['https://opentelemetry.io/schemas/1.31.0'] - stability: stable + stability: development - id: registry.otel.component type: attribute_group display_name: OTel Component Attributes From c33f978bd25dd565707a0721f577991e68f33fcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Paj=C4=85k?= Date: Tue, 15 Jul 2025 13:27:38 +0200 Subject: [PATCH 12/12] Update otel.md --- docs/registry/attributes/otel.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/registry/attributes/otel.md b/docs/registry/attributes/otel.md index 83062892e3..adcffba052 100644 --- a/docs/registry/attributes/otel.md +++ b/docs/registry/attributes/otel.md @@ -104,7 +104,7 @@ Attributes used by non-OTLP exporters to represent OpenTelemetry Scope's concept | Attribute | Type | Description | Examples | Stability | |---|---|---|---|---| | `otel.scope.name` | string | The name of the instrumentation scope - (`InstrumentationScope.Name` in OTLP). | `io.opentelemetry.contrib.mongodb` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | -| `otel.scope.schema_url` | string | The schema URL of the instrumentation scope. | `https://opentelemetry.io/schemas/1.31.0` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | +| `otel.scope.schema_url` | string | The schema URL of the instrumentation scope. | `https://opentelemetry.io/schemas/1.31.0` | ![Development](https://img.shields.io/badge/-development-blue) | | `otel.scope.version` | string | The version of the instrumentation scope - (`InstrumentationScope.Version` in OTLP). | `1.0.0` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | ## Deprecated OTel Library Attributes