Skip to content
17 changes: 17 additions & 0 deletions .chloggen/2489.yaml
Original file line number Diff line number Diff line change
@@ -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.<key>` 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]
4 changes: 4 additions & 0 deletions docs/registry/attributes/otel.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,13 @@ Attributes used by non-OTLP exporters to represent OpenTelemetry Scope's concept

| Attribute | Type | Description | Examples | Stability |
|---|---|---|---|---|
| <a id="otel-scope" href="#otel-scope">`otel.scope.<key>`</a> | string | The attributes of the instrumentation scope - (`InstrumentationScope.Attributes` in OTLP). `<key>` 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) |
| <a id="otel-scope-name" href="#otel-scope-name">`otel.scope.name`</a> | string | The name of the instrumentation scope - (`InstrumentationScope.Name` in OTLP). | `io.opentelemetry.contrib.mongodb` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| <a id="otel-scope-schema-url" href="#otel-scope-schema-url">`otel.scope.schema_url`</a> | string | The schema URL of the instrumentation scope. | `https://opentelemetry.io/schemas/1.31.0` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| <a id="otel-scope-version" href="#otel-scope-version">`otel.scope.version`</a> | 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.<key>`:** 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.
Expand Down
4 changes: 4 additions & 0 deletions docs/registry/entities/otel.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,12 @@

| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
|---|---|---|---|---|---|
| [`otel.scope.<key>`](/docs/registry/attributes/otel.md) | string | The attributes of the instrumentation scope - (`InstrumentationScope.Attributes` in OTLP). `<key>` 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.<key>`:** For example, an instrumentation scope attribute `foo` with value `12` SHOULD be recorded as the `otel.scope.foo` attribute with value `12`.


<!-- markdownlint-restore -->
4 changes: 4 additions & 0 deletions model/otel/deprecated/entities-deprecated.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,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
Comment thread
pellared marked this conversation as resolved.
Outdated
16 changes: 16 additions & 0 deletions model/otel/registry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,22 @@ 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.
Comment thread
pellared marked this conversation as resolved.
examples: ['https://opentelemetry.io/schemas/1.31.0']
stability: stable
Comment thread
pellared marked this conversation as resolved.
Outdated
Comment thread
pellared marked this conversation as resolved.
Outdated
- id: otel.scope
Comment thread
pellared marked this conversation as resolved.
Outdated
type: template[string]
brief: >
The attributes of the instrumentation scope - (`InstrumentationScope.Attributes` in OTLP).
`<key>` 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
Expand Down
3 changes: 3 additions & 0 deletions policies/attribute_name_collisions.rego
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Comment thread
pellared marked this conversation as resolved.
Outdated

collisions := [other.name |
other := attribute_names[_]
not other.deprecated
Expand Down
Loading