From ea7d7ec9ed1a92ffff15b19743f2730d78f22314 Mon Sep 17 00:00:00 2001 From: David Ashpole Date: Tue, 16 Dec 2025 19:54:53 +0000 Subject: [PATCH 01/12] add DefaultDisabled advisory parameter --- CHANGELOG.md | 3 +++ spec-compliance-matrix.md | 1 + spec-compliance-matrix/cpp.yaml | 2 ++ spec-compliance-matrix/dotnet.yaml | 2 ++ spec-compliance-matrix/erlang.yaml | 2 ++ spec-compliance-matrix/go.yaml | 2 ++ spec-compliance-matrix/java.yaml | 2 ++ spec-compliance-matrix/js.yaml | 2 ++ spec-compliance-matrix/php.yaml | 2 ++ spec-compliance-matrix/python.yaml | 2 ++ spec-compliance-matrix/ruby.yaml | 2 ++ spec-compliance-matrix/rust.yaml | 2 ++ spec-compliance-matrix/swift.yaml | 2 ++ spec-compliance-matrix/template.yaml | 1 + specification/metrics/api.md | 11 +++++++++++ specification/metrics/sdk.md | 21 ++++++++++++++++++--- 16 files changed, 56 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0bc0648f16a..8ee041845ca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,9 @@ release. ### Metrics +- Add the DefaultDisabled advisory parameter. + ([#4809](https://github.com/open-telemetry/opentelemetry-specification/pull/4809)) + ### Logs ### Baggage diff --git a/spec-compliance-matrix.md b/spec-compliance-matrix.md index 116a3b786cc..b4952475d83 100644 --- a/spec-compliance-matrix.md +++ b/spec-compliance-matrix.md @@ -130,6 +130,7 @@ formats is required. Implementing more than one format is optional. | Instrument descriptions conform to the specified syntax. | | - | + | | - | + | + | | | - | + | | | Instrument supports the advisory ExplicitBucketBoundaries parameter. | | + | + | | | | + | | | | | | | Instrument supports the advisory Attributes parameter. | | - | + | | | | + | | | | | | +| Instrument supports the advisory DefaultDisabled parameter. | | - | - | - | - | - | - | - | - | - | - | - | | All methods of `MeterProvider` are safe to be called concurrently. | | + | + | + | - | | + | | | + | + | | | All methods of `Meter` are safe to be called concurrently. | | + | + | + | - | | + | | | + | + | | | All methods of any instrument are safe to be called concurrently. | | + | + | + | - | | + | | | + | + | | diff --git a/spec-compliance-matrix/cpp.yaml b/spec-compliance-matrix/cpp.yaml index 65ae3abfe76..32ce460a34b 100644 --- a/spec-compliance-matrix/cpp.yaml +++ b/spec-compliance-matrix/cpp.yaml @@ -223,6 +223,8 @@ sections: status: '?' - name: Instrument supports the advisory Attributes parameter. status: '?' + - name: Instrument supports the advisory DefaultDisabled parameter. + status: '-' - name: All methods of `MeterProvider` are safe to be called concurrently. status: '+' - name: All methods of `Meter` are safe to be called concurrently. diff --git a/spec-compliance-matrix/dotnet.yaml b/spec-compliance-matrix/dotnet.yaml index f5d51a066d3..68a6b8a2bf0 100644 --- a/spec-compliance-matrix/dotnet.yaml +++ b/spec-compliance-matrix/dotnet.yaml @@ -223,6 +223,8 @@ sections: status: '?' - name: Instrument supports the advisory Attributes parameter. status: '?' + - name: Instrument supports the advisory DefaultDisabled parameter. + status: '-' - name: All methods of `MeterProvider` are safe to be called concurrently. status: '+' - name: All methods of `Meter` are safe to be called concurrently. diff --git a/spec-compliance-matrix/erlang.yaml b/spec-compliance-matrix/erlang.yaml index 7d5d680d6a5..da8cf718554 100644 --- a/spec-compliance-matrix/erlang.yaml +++ b/spec-compliance-matrix/erlang.yaml @@ -223,6 +223,8 @@ sections: status: '+' - name: Instrument supports the advisory Attributes parameter. status: '+' + - name: Instrument supports the advisory DefaultDisabled parameter. + status: '-' - name: All methods of `MeterProvider` are safe to be called concurrently. status: '+' - name: All methods of `Meter` are safe to be called concurrently. diff --git a/spec-compliance-matrix/go.yaml b/spec-compliance-matrix/go.yaml index 7b3fb26a4b6..d2016ee601a 100644 --- a/spec-compliance-matrix/go.yaml +++ b/spec-compliance-matrix/go.yaml @@ -223,6 +223,8 @@ sections: status: '+' - name: Instrument supports the advisory Attributes parameter. status: '-' + - name: Instrument supports the advisory DefaultDisabled parameter. + status: '-' - name: All methods of `MeterProvider` are safe to be called concurrently. status: '+' - name: All methods of `Meter` are safe to be called concurrently. diff --git a/spec-compliance-matrix/java.yaml b/spec-compliance-matrix/java.yaml index e3fe29f9ad3..369e3ce32ab 100644 --- a/spec-compliance-matrix/java.yaml +++ b/spec-compliance-matrix/java.yaml @@ -223,6 +223,8 @@ sections: status: '+' - name: Instrument supports the advisory Attributes parameter. status: '+' + - name: Instrument supports the advisory DefaultDisabled parameter. + status: '-' - name: All methods of `MeterProvider` are safe to be called concurrently. status: '+' - name: All methods of `Meter` are safe to be called concurrently. diff --git a/spec-compliance-matrix/js.yaml b/spec-compliance-matrix/js.yaml index a7154980e30..fd4236c6ca8 100644 --- a/spec-compliance-matrix/js.yaml +++ b/spec-compliance-matrix/js.yaml @@ -223,6 +223,8 @@ sections: status: '?' - name: Instrument supports the advisory Attributes parameter. status: '?' + - name: Instrument supports the advisory DefaultDisabled parameter. + status: '-' - name: All methods of `MeterProvider` are safe to be called concurrently. status: '+' - name: All methods of `Meter` are safe to be called concurrently. diff --git a/spec-compliance-matrix/php.yaml b/spec-compliance-matrix/php.yaml index 1d506cafd6f..d8e940d7188 100644 --- a/spec-compliance-matrix/php.yaml +++ b/spec-compliance-matrix/php.yaml @@ -223,6 +223,8 @@ sections: status: '?' - name: Instrument supports the advisory Attributes parameter. status: '?' + - name: Instrument supports the advisory DefaultDisabled parameter. + status: '-' - name: All methods of `MeterProvider` are safe to be called concurrently. status: '?' - name: All methods of `Meter` are safe to be called concurrently. diff --git a/spec-compliance-matrix/python.yaml b/spec-compliance-matrix/python.yaml index 9c686be08a1..638cc5ce1d0 100644 --- a/spec-compliance-matrix/python.yaml +++ b/spec-compliance-matrix/python.yaml @@ -223,6 +223,8 @@ sections: status: '?' - name: Instrument supports the advisory Attributes parameter. status: '?' + - name: Instrument supports the advisory DefaultDisabled parameter. + status: '-' - name: All methods of `MeterProvider` are safe to be called concurrently. status: '-' - name: All methods of `Meter` are safe to be called concurrently. diff --git a/spec-compliance-matrix/ruby.yaml b/spec-compliance-matrix/ruby.yaml index 0c690c00109..a7d1b47e4ba 100644 --- a/spec-compliance-matrix/ruby.yaml +++ b/spec-compliance-matrix/ruby.yaml @@ -223,6 +223,8 @@ sections: status: '?' - name: Instrument supports the advisory Attributes parameter. status: '?' + - name: Instrument supports the advisory DefaultDisabled parameter. + status: '-' - name: All methods of `MeterProvider` are safe to be called concurrently. status: '?' - name: All methods of `Meter` are safe to be called concurrently. diff --git a/spec-compliance-matrix/rust.yaml b/spec-compliance-matrix/rust.yaml index 1f3cb6913f3..f0e8ac6bbc5 100644 --- a/spec-compliance-matrix/rust.yaml +++ b/spec-compliance-matrix/rust.yaml @@ -223,6 +223,8 @@ sections: status: '?' - name: Instrument supports the advisory Attributes parameter. status: '?' + - name: Instrument supports the advisory DefaultDisabled parameter. + status: '-' - name: All methods of `MeterProvider` are safe to be called concurrently. status: '?' - name: All methods of `Meter` are safe to be called concurrently. diff --git a/spec-compliance-matrix/swift.yaml b/spec-compliance-matrix/swift.yaml index 5ff118465d6..08ea49b804a 100644 --- a/spec-compliance-matrix/swift.yaml +++ b/spec-compliance-matrix/swift.yaml @@ -223,6 +223,8 @@ sections: status: '?' - name: Instrument supports the advisory Attributes parameter. status: '?' + - name: Instrument supports the advisory DefaultDisabled parameter. + status: '-' - name: All methods of `MeterProvider` are safe to be called concurrently. status: '?' - name: All methods of `Meter` are safe to be called concurrently. diff --git a/spec-compliance-matrix/template.yaml b/spec-compliance-matrix/template.yaml index 3013f98e178..e0fcfdcae40 100644 --- a/spec-compliance-matrix/template.yaml +++ b/spec-compliance-matrix/template.yaml @@ -155,6 +155,7 @@ sections: - name: Instrument descriptions conform to the specified syntax. - name: Instrument supports the advisory ExplicitBucketBoundaries parameter. - name: Instrument supports the advisory Attributes parameter. + - name: Instrument supports the advisory DefaultDisabled parameter. - name: All methods of `MeterProvider` are safe to be called concurrently. - name: All methods of `Meter` are safe to be called concurrently. - name: All methods of any instrument are safe to be called concurrently. diff --git a/specification/metrics/api.md b/specification/metrics/api.md index c37fccc944d..0197015e8dd 100644 --- a/specification/metrics/api.md +++ b/specification/metrics/api.md @@ -26,6 +26,7 @@ weight: 1 + [Instrument advisory parameters](#instrument-advisory-parameters) - [Instrument advisory parameter: `ExplicitBucketBoundaries`](#instrument-advisory-parameter-explicitbucketboundaries) - [Instrument advisory parameter: `Attributes`](#instrument-advisory-parameter-attributes) + - [Instrument advisory parameter: `DefaultDisabled`](#instrument-advisory-parameter-defaultdisabled) + [Synchronous and Asynchronous instruments](#synchronous-and-asynchronous-instruments) - [Synchronous Instrument API](#synchronous-instrument-api) - [Asynchronous Instrument API](#asynchronous-instrument-api) @@ -276,6 +277,16 @@ Applies to all instrument types. `Attributes` (a list of [attribute keys](../common/README.md#attribute)) is the recommended set of attribute keys to be used for the resulting metrics. +##### Instrument advisory parameter: `DefaultDisabled` + +**Status**: [Development](../document-status.md) + +Applies to all instrument types. + +`DefaultDisabled` indicates that the instrument should not produce metric data +and functions on the instrument should be no-ops unless the user has explicitly +enabled the metric. + #### Synchronous and Asynchronous instruments Instruments are categorized on whether they are synchronous or diff --git a/specification/metrics/sdk.md b/specification/metrics/sdk.md index 0c3da4b83fc..d0473b03d7d 100644 --- a/specification/metrics/sdk.md +++ b/specification/metrics/sdk.md @@ -52,6 +52,7 @@ weight: 3 * [Instrument advisory parameters](#instrument-advisory-parameters) + [Instrument advisory parameter: `ExplicitBucketBoundaries`](#instrument-advisory-parameter-explicitbucketboundaries) + [Instrument advisory parameter: `Attributes`](#instrument-advisory-parameter-attributes) + + [Instrument advisory parameter: `DefaultDisabled`](#instrument-advisory-parameter-defaultdisabled) * [Instrument enabled](#instrument-enabled) - [Attribute limits](#attribute-limits) - [Exemplar](#exemplar) @@ -420,9 +421,13 @@ The SDK SHOULD use the following logic to determine how to process Measurements made with an Instrument: * Determine the `MeterProvider` which "owns" the Instrument. -* If the `MeterProvider` has no `View` registered, take the Instrument - and apply the default Aggregation on the basis of instrument kind according - to the [MetricReader](#metricreader) instance's `aggregation` property. +* If the `MeterProvider` has no `View` registered: + * **Status**: [Development](../document-status.md) - If the instrument's + [DefaultDisabled advisory parameter](#instrument-advisory-parameter-defaultdisabled) + is set, use the [Drop Aggregation](#drop-aggregation). + * If DefaultDisabled is not set, take the Instrument and apply the default + Aggregation on the basis of instrument kind according to the + [MetricReader](#metricreader) instance's `aggregation` property. [Instrument advisory parameters](#instrument-advisory-parameters), if any, MUST be honored. * If the `MeterProvider` has one or more `View`(s) registered: @@ -999,6 +1004,16 @@ If no View is configured, or if a matching view does not specify attribute keys, the advisory parameter should be used. If neither is provided, all attributes must be retained. +#### Instrument advisory parameter: `DefaultDisabled` + +**Status**: [Development](../document-status.md) + +This advisory parameter applies to all aggregations. + +When an instrument is `DefaultDisabled`, the SDK MUST use the +[Drop Aggregation](#drop-aggregation) by default. If the user has provided an +Aggregation via View(s), that aggregation takes precedence. + ### Instrument enabled The synchronous instrument [`Enabled`](./api.md#enabled) MUST return `false` From 03cbc8090cae60bdcd34857e0a40ec3bdaeedb96 Mon Sep 17 00:00:00 2001 From: David Ashpole Date: Tue, 16 Dec 2025 21:55:06 +0000 Subject: [PATCH 02/12] make bool explicit --- specification/metrics/api.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/specification/metrics/api.md b/specification/metrics/api.md index 0197015e8dd..260a49f7e66 100644 --- a/specification/metrics/api.md +++ b/specification/metrics/api.md @@ -283,9 +283,9 @@ the recommended set of attribute keys to be used for the resulting metrics. Applies to all instrument types. -`DefaultDisabled` indicates that the instrument should not produce metric data -and functions on the instrument should be no-ops unless the user has explicitly -enabled the metric. +`DefaultDisabled` (bool) if true, indicates that the instrument should not +produce metric data and that functions on the instrument should be no-ops +unless the user has explicitly enabled the metric. #### Synchronous and Asynchronous instruments From 2e3fbd2922c6108e8f1c4e42e460932ec84a2376 Mon Sep 17 00:00:00 2001 From: David Ashpole Date: Mon, 5 Jan 2026 21:08:19 +0000 Subject: [PATCH 03/12] rename to OptIn --- CHANGELOG.md | 2 +- spec-compliance-matrix.md | 2 +- spec-compliance-matrix/cpp.yaml | 2 +- spec-compliance-matrix/dotnet.yaml | 2 +- spec-compliance-matrix/erlang.yaml | 2 +- spec-compliance-matrix/go.yaml | 2 +- spec-compliance-matrix/java.yaml | 2 +- spec-compliance-matrix/js.yaml | 2 +- spec-compliance-matrix/php.yaml | 2 +- spec-compliance-matrix/python.yaml | 2 +- spec-compliance-matrix/ruby.yaml | 2 +- spec-compliance-matrix/rust.yaml | 2 +- spec-compliance-matrix/swift.yaml | 2 +- spec-compliance-matrix/template.yaml | 2 +- specification/metrics/api.md | 6 +++--- specification/metrics/sdk.md | 12 ++++++------ 16 files changed, 23 insertions(+), 23 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ee041845ca..93072979516 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,7 +13,7 @@ release. ### Metrics -- Add the DefaultDisabled advisory parameter. +- Add the OptIn advisory parameter. ([#4809](https://github.com/open-telemetry/opentelemetry-specification/pull/4809)) ### Logs diff --git a/spec-compliance-matrix.md b/spec-compliance-matrix.md index b4952475d83..23cc47f9d94 100644 --- a/spec-compliance-matrix.md +++ b/spec-compliance-matrix.md @@ -130,7 +130,7 @@ formats is required. Implementing more than one format is optional. | Instrument descriptions conform to the specified syntax. | | - | + | | - | + | + | | | - | + | | | Instrument supports the advisory ExplicitBucketBoundaries parameter. | | + | + | | | | + | | | | | | | Instrument supports the advisory Attributes parameter. | | - | + | | | | + | | | | | | -| Instrument supports the advisory DefaultDisabled parameter. | | - | - | - | - | - | - | - | - | - | - | - | +| Instrument supports the advisory OptIn parameter. | | - | - | - | - | - | - | - | - | - | - | - | | All methods of `MeterProvider` are safe to be called concurrently. | | + | + | + | - | | + | | | + | + | | | All methods of `Meter` are safe to be called concurrently. | | + | + | + | - | | + | | | + | + | | | All methods of any instrument are safe to be called concurrently. | | + | + | + | - | | + | | | + | + | | diff --git a/spec-compliance-matrix/cpp.yaml b/spec-compliance-matrix/cpp.yaml index 32ce460a34b..cba61a615ac 100644 --- a/spec-compliance-matrix/cpp.yaml +++ b/spec-compliance-matrix/cpp.yaml @@ -223,7 +223,7 @@ sections: status: '?' - name: Instrument supports the advisory Attributes parameter. status: '?' - - name: Instrument supports the advisory DefaultDisabled parameter. + - name: Instrument supports the advisory OptIn parameter. status: '-' - name: All methods of `MeterProvider` are safe to be called concurrently. status: '+' diff --git a/spec-compliance-matrix/dotnet.yaml b/spec-compliance-matrix/dotnet.yaml index 68a6b8a2bf0..da8a933b50b 100644 --- a/spec-compliance-matrix/dotnet.yaml +++ b/spec-compliance-matrix/dotnet.yaml @@ -223,7 +223,7 @@ sections: status: '?' - name: Instrument supports the advisory Attributes parameter. status: '?' - - name: Instrument supports the advisory DefaultDisabled parameter. + - name: Instrument supports the advisory OptIn parameter. status: '-' - name: All methods of `MeterProvider` are safe to be called concurrently. status: '+' diff --git a/spec-compliance-matrix/erlang.yaml b/spec-compliance-matrix/erlang.yaml index da8cf718554..e42d3231bef 100644 --- a/spec-compliance-matrix/erlang.yaml +++ b/spec-compliance-matrix/erlang.yaml @@ -223,7 +223,7 @@ sections: status: '+' - name: Instrument supports the advisory Attributes parameter. status: '+' - - name: Instrument supports the advisory DefaultDisabled parameter. + - name: Instrument supports the advisory OptIn parameter. status: '-' - name: All methods of `MeterProvider` are safe to be called concurrently. status: '+' diff --git a/spec-compliance-matrix/go.yaml b/spec-compliance-matrix/go.yaml index d2016ee601a..c79d6474093 100644 --- a/spec-compliance-matrix/go.yaml +++ b/spec-compliance-matrix/go.yaml @@ -223,7 +223,7 @@ sections: status: '+' - name: Instrument supports the advisory Attributes parameter. status: '-' - - name: Instrument supports the advisory DefaultDisabled parameter. + - name: Instrument supports the advisory OptIn parameter. status: '-' - name: All methods of `MeterProvider` are safe to be called concurrently. status: '+' diff --git a/spec-compliance-matrix/java.yaml b/spec-compliance-matrix/java.yaml index 369e3ce32ab..33fec46a511 100644 --- a/spec-compliance-matrix/java.yaml +++ b/spec-compliance-matrix/java.yaml @@ -223,7 +223,7 @@ sections: status: '+' - name: Instrument supports the advisory Attributes parameter. status: '+' - - name: Instrument supports the advisory DefaultDisabled parameter. + - name: Instrument supports the advisory OptIn parameter. status: '-' - name: All methods of `MeterProvider` are safe to be called concurrently. status: '+' diff --git a/spec-compliance-matrix/js.yaml b/spec-compliance-matrix/js.yaml index fd4236c6ca8..3739111b8b0 100644 --- a/spec-compliance-matrix/js.yaml +++ b/spec-compliance-matrix/js.yaml @@ -223,7 +223,7 @@ sections: status: '?' - name: Instrument supports the advisory Attributes parameter. status: '?' - - name: Instrument supports the advisory DefaultDisabled parameter. + - name: Instrument supports the advisory OptIn parameter. status: '-' - name: All methods of `MeterProvider` are safe to be called concurrently. status: '+' diff --git a/spec-compliance-matrix/php.yaml b/spec-compliance-matrix/php.yaml index d8e940d7188..8e7587015ce 100644 --- a/spec-compliance-matrix/php.yaml +++ b/spec-compliance-matrix/php.yaml @@ -223,7 +223,7 @@ sections: status: '?' - name: Instrument supports the advisory Attributes parameter. status: '?' - - name: Instrument supports the advisory DefaultDisabled parameter. + - name: Instrument supports the advisory OptIn parameter. status: '-' - name: All methods of `MeterProvider` are safe to be called concurrently. status: '?' diff --git a/spec-compliance-matrix/python.yaml b/spec-compliance-matrix/python.yaml index 638cc5ce1d0..592a02cf991 100644 --- a/spec-compliance-matrix/python.yaml +++ b/spec-compliance-matrix/python.yaml @@ -223,7 +223,7 @@ sections: status: '?' - name: Instrument supports the advisory Attributes parameter. status: '?' - - name: Instrument supports the advisory DefaultDisabled parameter. + - name: Instrument supports the advisory OptIn parameter. status: '-' - name: All methods of `MeterProvider` are safe to be called concurrently. status: '-' diff --git a/spec-compliance-matrix/ruby.yaml b/spec-compliance-matrix/ruby.yaml index a7d1b47e4ba..7acb5e6a3d3 100644 --- a/spec-compliance-matrix/ruby.yaml +++ b/spec-compliance-matrix/ruby.yaml @@ -223,7 +223,7 @@ sections: status: '?' - name: Instrument supports the advisory Attributes parameter. status: '?' - - name: Instrument supports the advisory DefaultDisabled parameter. + - name: Instrument supports the advisory OptIn parameter. status: '-' - name: All methods of `MeterProvider` are safe to be called concurrently. status: '?' diff --git a/spec-compliance-matrix/rust.yaml b/spec-compliance-matrix/rust.yaml index f0e8ac6bbc5..c85d7f1eebb 100644 --- a/spec-compliance-matrix/rust.yaml +++ b/spec-compliance-matrix/rust.yaml @@ -223,7 +223,7 @@ sections: status: '?' - name: Instrument supports the advisory Attributes parameter. status: '?' - - name: Instrument supports the advisory DefaultDisabled parameter. + - name: Instrument supports the advisory OptIn parameter. status: '-' - name: All methods of `MeterProvider` are safe to be called concurrently. status: '?' diff --git a/spec-compliance-matrix/swift.yaml b/spec-compliance-matrix/swift.yaml index 08ea49b804a..5dde92f7475 100644 --- a/spec-compliance-matrix/swift.yaml +++ b/spec-compliance-matrix/swift.yaml @@ -223,7 +223,7 @@ sections: status: '?' - name: Instrument supports the advisory Attributes parameter. status: '?' - - name: Instrument supports the advisory DefaultDisabled parameter. + - name: Instrument supports the advisory OptIn parameter. status: '-' - name: All methods of `MeterProvider` are safe to be called concurrently. status: '?' diff --git a/spec-compliance-matrix/template.yaml b/spec-compliance-matrix/template.yaml index e0fcfdcae40..ac6fba7c328 100644 --- a/spec-compliance-matrix/template.yaml +++ b/spec-compliance-matrix/template.yaml @@ -155,7 +155,7 @@ sections: - name: Instrument descriptions conform to the specified syntax. - name: Instrument supports the advisory ExplicitBucketBoundaries parameter. - name: Instrument supports the advisory Attributes parameter. - - name: Instrument supports the advisory DefaultDisabled parameter. + - name: Instrument supports the advisory OptIn parameter. - name: All methods of `MeterProvider` are safe to be called concurrently. - name: All methods of `Meter` are safe to be called concurrently. - name: All methods of any instrument are safe to be called concurrently. diff --git a/specification/metrics/api.md b/specification/metrics/api.md index 260a49f7e66..bd50816a058 100644 --- a/specification/metrics/api.md +++ b/specification/metrics/api.md @@ -26,7 +26,7 @@ weight: 1 + [Instrument advisory parameters](#instrument-advisory-parameters) - [Instrument advisory parameter: `ExplicitBucketBoundaries`](#instrument-advisory-parameter-explicitbucketboundaries) - [Instrument advisory parameter: `Attributes`](#instrument-advisory-parameter-attributes) - - [Instrument advisory parameter: `DefaultDisabled`](#instrument-advisory-parameter-defaultdisabled) + - [Instrument advisory parameter: `OptIn`](#instrument-advisory-parameter-optin) + [Synchronous and Asynchronous instruments](#synchronous-and-asynchronous-instruments) - [Synchronous Instrument API](#synchronous-instrument-api) - [Asynchronous Instrument API](#asynchronous-instrument-api) @@ -277,13 +277,13 @@ Applies to all instrument types. `Attributes` (a list of [attribute keys](../common/README.md#attribute)) is the recommended set of attribute keys to be used for the resulting metrics. -##### Instrument advisory parameter: `DefaultDisabled` +##### Instrument advisory parameter: `OptIn` **Status**: [Development](../document-status.md) Applies to all instrument types. -`DefaultDisabled` (bool) if true, indicates that the instrument should not +`OptIn` (bool) if true, indicates that the instrument should not produce metric data and that functions on the instrument should be no-ops unless the user has explicitly enabled the metric. diff --git a/specification/metrics/sdk.md b/specification/metrics/sdk.md index d0473b03d7d..c2ac40d7af8 100644 --- a/specification/metrics/sdk.md +++ b/specification/metrics/sdk.md @@ -52,7 +52,7 @@ weight: 3 * [Instrument advisory parameters](#instrument-advisory-parameters) + [Instrument advisory parameter: `ExplicitBucketBoundaries`](#instrument-advisory-parameter-explicitbucketboundaries) + [Instrument advisory parameter: `Attributes`](#instrument-advisory-parameter-attributes) - + [Instrument advisory parameter: `DefaultDisabled`](#instrument-advisory-parameter-defaultdisabled) + + [Instrument advisory parameter: `OptIn`](#instrument-advisory-parameter-OptIn) * [Instrument enabled](#instrument-enabled) - [Attribute limits](#attribute-limits) - [Exemplar](#exemplar) @@ -423,9 +423,9 @@ made with an Instrument: * Determine the `MeterProvider` which "owns" the Instrument. * If the `MeterProvider` has no `View` registered: * **Status**: [Development](../document-status.md) - If the instrument's - [DefaultDisabled advisory parameter](#instrument-advisory-parameter-defaultdisabled) - is set, use the [Drop Aggregation](#drop-aggregation). - * If DefaultDisabled is not set, take the Instrument and apply the default + [OptIn advisory parameter](#instrument-advisory-parameter-OptIn) + is set to true, use the [Drop Aggregation](#drop-aggregation). + * If OptIn is false, take the Instrument and apply the default Aggregation on the basis of instrument kind according to the [MetricReader](#metricreader) instance's `aggregation` property. [Instrument advisory parameters](#instrument-advisory-parameters), if any, @@ -1004,13 +1004,13 @@ If no View is configured, or if a matching view does not specify attribute keys, the advisory parameter should be used. If neither is provided, all attributes must be retained. -#### Instrument advisory parameter: `DefaultDisabled` +#### Instrument advisory parameter: `OptIn` **Status**: [Development](../document-status.md) This advisory parameter applies to all aggregations. -When an instrument is `DefaultDisabled`, the SDK MUST use the +When an instrument is `OptIn`, the SDK MUST use the [Drop Aggregation](#drop-aggregation) by default. If the user has provided an Aggregation via View(s), that aggregation takes precedence. From 37821ea404e467ebd39709e15a244cd2c465e722 Mon Sep 17 00:00:00 2001 From: David Ashpole Date: Mon, 5 Jan 2026 21:37:02 +0000 Subject: [PATCH 04/12] clarify that advisory parameters apply when views are registered, but don't match --- specification/metrics/sdk.md | 45 ++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/specification/metrics/sdk.md b/specification/metrics/sdk.md index c2ac40d7af8..f8587e28f57 100644 --- a/specification/metrics/sdk.md +++ b/specification/metrics/sdk.md @@ -421,7 +421,8 @@ The SDK SHOULD use the following logic to determine how to process Measurements made with an Instrument: * Determine the `MeterProvider` which "owns" the Instrument. -* If the `MeterProvider` has no `View` registered: +* If the `MeterProvider` has no `View` registered, or if the Instrument does + not match any View's instrument selection criteria: * **Status**: [Development](../document-status.md) - If the instrument's [OptIn advisory parameter](#instrument-advisory-parameter-OptIn) is set to true, use the [Drop Aggregation](#drop-aggregation). @@ -430,28 +431,26 @@ made with an Instrument: [MetricReader](#metricreader) instance's `aggregation` property. [Instrument advisory parameters](#instrument-advisory-parameters), if any, MUST be honored. -* If the `MeterProvider` has one or more `View`(s) registered: - * If the Instrument could match the instrument selection criteria, for each - View: - * Try to apply the View's stream configuration independently of any other - Views registered for the same matching Instrument (i.e. Views are not - merged). This may result in [conflicting metric identities](./data-model.md#opentelemetry-protocol-data-model-producer-recommendations) - even if stream configurations specify non-overlapping properties (e.g. - one View setting `aggregation` and another View setting `attribute_keys`, - both leaving the stream `name` as the default configured by the - Instrument). If applying the View results in conflicting metric identities - the implementation SHOULD apply the View and emit a warning. If it is not - possible to apply the View without producing semantic errors (e.g. the - View sets an asynchronous instrument to use the [Explicit bucket - histogram aggregation](#explicit-bucket-histogram-aggregation)) the - implementation SHOULD emit a warning and proceed as if the View did not - If both a View and [Instrument advisory parameters](#instrument-advisory-parameters) - specify the same aspect of the [Stream configuration](#stream-configuration), - the setting defined by the View MUST take precedence over the advisory parameters. - * If the Instrument could not match with any of the registered `View`(s), the - SDK SHOULD enable the instrument using the default aggregation and temporality. - Users can configure match-all Views using [Drop aggregation](#drop-aggregation) - to disable instruments by default. +* If the `MeterProvider` has one or more matching `View`(s) registered, for + each `View` that matches the instrument selection criteria: + * Try to apply the View's stream configuration independently of any other + Views registered for the same matching Instrument (i.e. Views are not + merged). This may result in [conflicting metric identities](./data-model.md#opentelemetry-protocol-data-model-producer-recommendations) + even if stream configurations specify non-overlapping properties (e.g. + one View setting `aggregation` and another View setting `attribute_keys`, + both leaving the stream `name` as the default configured by the + Instrument). If applying the View results in conflicting metric identities + the implementation SHOULD apply the View and emit a warning. If it is not + possible to apply the View without producing semantic errors (e.g. the + View sets an asynchronous instrument to use the [Explicit bucket + histogram aggregation](#explicit-bucket-histogram-aggregation)) the + implementation SHOULD emit a warning and proceed as if the View did not + If both a View and [Instrument advisory parameters](#instrument-advisory-parameters) + specify the same aspect of the [Stream configuration](#stream-configuration), + the setting defined by the View MUST take precedence over the advisory parameters. + +Users can configure match-all Views using [Drop aggregation](#drop-aggregation) +to disable instruments by default. #### View examples From fb933a879330d29f200cee61d4ef67af44f6c6fe Mon Sep 17 00:00:00 2001 From: David Ashpole Date: Mon, 5 Jan 2026 21:41:50 +0000 Subject: [PATCH 05/12] fix lint --- specification/metrics/sdk.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/metrics/sdk.md b/specification/metrics/sdk.md index f8587e28f57..0d70e86fbe1 100644 --- a/specification/metrics/sdk.md +++ b/specification/metrics/sdk.md @@ -52,7 +52,7 @@ weight: 3 * [Instrument advisory parameters](#instrument-advisory-parameters) + [Instrument advisory parameter: `ExplicitBucketBoundaries`](#instrument-advisory-parameter-explicitbucketboundaries) + [Instrument advisory parameter: `Attributes`](#instrument-advisory-parameter-attributes) - + [Instrument advisory parameter: `OptIn`](#instrument-advisory-parameter-OptIn) + + [Instrument advisory parameter: `OptIn`](#instrument-advisory-parameter-optin) * [Instrument enabled](#instrument-enabled) - [Attribute limits](#attribute-limits) - [Exemplar](#exemplar) @@ -424,7 +424,7 @@ made with an Instrument: * If the `MeterProvider` has no `View` registered, or if the Instrument does not match any View's instrument selection criteria: * **Status**: [Development](../document-status.md) - If the instrument's - [OptIn advisory parameter](#instrument-advisory-parameter-OptIn) + [OptIn advisory parameter](#instrument-advisory-parameter-optin) is set to true, use the [Drop Aggregation](#drop-aggregation). * If OptIn is false, take the Instrument and apply the default Aggregation on the basis of instrument kind according to the From d6471063854aca901c1423b38944c1434f615b4a Mon Sep 17 00:00:00 2001 From: David Ashpole Date: Tue, 6 Jan 2026 10:27:48 -0500 Subject: [PATCH 06/12] Update specification/metrics/api.md Co-authored-by: Tyler Yahn --- specification/metrics/api.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/metrics/api.md b/specification/metrics/api.md index bd50816a058..7439b6ab9d4 100644 --- a/specification/metrics/api.md +++ b/specification/metrics/api.md @@ -283,8 +283,8 @@ the recommended set of attribute keys to be used for the resulting metrics. Applies to all instrument types. -`OptIn` (bool) if true, indicates that the instrument should not -produce metric data and that functions on the instrument should be no-ops +`OptIn` (bool) if true, indicates that the instrument MUST NOT +produce metric data and that functions on the instrument SHOULD be no-ops unless the user has explicitly enabled the metric. #### Synchronous and Asynchronous instruments From 23bcef0fe26951fd9b478bbeeb9c5da0b6d8be1b Mon Sep 17 00:00:00 2001 From: David Ashpole Date: Tue, 6 Jan 2026 21:26:22 +0000 Subject: [PATCH 07/12] clarify that the defualt aggregation enables OptIn instruments --- specification/metrics/sdk.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/specification/metrics/sdk.md b/specification/metrics/sdk.md index 0d70e86fbe1..c8e2aac37ae 100644 --- a/specification/metrics/sdk.md +++ b/specification/metrics/sdk.md @@ -1011,7 +1011,10 @@ This advisory parameter applies to all aggregations. When an instrument is `OptIn`, the SDK MUST use the [Drop Aggregation](#drop-aggregation) by default. If the user has provided an -Aggregation via View(s), that aggregation takes precedence. +Aggregation via View(s), that aggregation takes precedence. If the user +provides the [Default Aggregation](#default-aggregation) using a View, this +"enables" the instrument with the same behavior as-if the instrument was not +`OptIn`--including respecting other advisory parameters. ### Instrument enabled From 5929f555fe8dff00ec14a4279c6a515a286e8605 Mon Sep 17 00:00:00 2001 From: David Ashpole Date: Thu, 8 Jan 2026 11:32:05 -0500 Subject: [PATCH 08/12] Update specification/metrics/sdk.md Co-authored-by: Cijo Thomas --- specification/metrics/sdk.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/metrics/sdk.md b/specification/metrics/sdk.md index c8e2aac37ae..98d74190f6c 100644 --- a/specification/metrics/sdk.md +++ b/specification/metrics/sdk.md @@ -1009,7 +1009,7 @@ must be retained. This advisory parameter applies to all aggregations. -When an instrument is `OptIn`, the SDK MUST use the +When an instrument has `OptIn=true`, the SDK MUST use the [Drop Aggregation](#drop-aggregation) by default. If the user has provided an Aggregation via View(s), that aggregation takes precedence. If the user provides the [Default Aggregation](#default-aggregation) using a View, this From e79e34fcb43d8b03d784fde3a8237ea8385c5639 Mon Sep 17 00:00:00 2001 From: David Ashpole Date: Thu, 8 Jan 2026 20:53:10 +0000 Subject: [PATCH 09/12] add explicit enabled field to view configuration --- specification/metrics/sdk.md | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/specification/metrics/sdk.md b/specification/metrics/sdk.md index 98d74190f6c..3696b61390f 100644 --- a/specification/metrics/sdk.md +++ b/specification/metrics/sdk.md @@ -414,6 +414,11 @@ The SDK MUST accept the following stream configuration parameters: `aggregation_cardinality_limit` value, the `MeterProvider` MUST apply the [default aggregation cardinality limit](#metricreader) the `MetricReader` is configured with. +* **Status**: [Development](../document-status.md) - `enabled` (optional): A + boolean denoting whether the instrument should be enabled. When `enabled` is + `false`, the View uses the `DropAggregation`, regardless of the `aggregation` + provided. If unset, the default is `true` unless the `OptIn` + parameter is `true`. #### Measurement processing @@ -449,8 +454,8 @@ made with an Instrument: specify the same aspect of the [Stream configuration](#stream-configuration), the setting defined by the View MUST take precedence over the advisory parameters. -Users can configure match-all Views using [Drop aggregation](#drop-aggregation) -to disable instruments by default. +Users can configure match-all Views with `enabled=false` or with the +[Drop aggregation](#drop-aggregation), to disable instruments by default. #### View examples @@ -1010,11 +1015,12 @@ must be retained. This advisory parameter applies to all aggregations. When an instrument has `OptIn=true`, the SDK MUST use the -[Drop Aggregation](#drop-aggregation) by default. If the user has provided an -Aggregation via View(s), that aggregation takes precedence. If the user -provides the [Default Aggregation](#default-aggregation) using a View, this -"enables" the instrument with the same behavior as-if the instrument was not -`OptIn`--including respecting other advisory parameters. +[Drop Aggregation](#drop-aggregation). If the user sets `enabled=true` on a +View's [Stream configuration](#stream-configuration), this "enables" the +instrument with the same behavior as-if the instrument was not `OptIn` -- +including respecting other advisory parameters. Setting fields other than +`enabled` on the View, including setting the `aggregation`, does not enable +the instrument. ### Instrument enabled From 7899e97b02d40cfc9f010ef1e0d3773803483d2d Mon Sep 17 00:00:00 2001 From: David Ashpole Date: Thu, 8 Jan 2026 20:55:13 +0000 Subject: [PATCH 10/12] address wording feedback --- specification/metrics/sdk.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/metrics/sdk.md b/specification/metrics/sdk.md index 3696b61390f..af8c520b881 100644 --- a/specification/metrics/sdk.md +++ b/specification/metrics/sdk.md @@ -1017,7 +1017,7 @@ This advisory parameter applies to all aggregations. When an instrument has `OptIn=true`, the SDK MUST use the [Drop Aggregation](#drop-aggregation). If the user sets `enabled=true` on a View's [Stream configuration](#stream-configuration), this "enables" the -instrument with the same behavior as-if the instrument was not `OptIn` -- +instrument with the same behavior as-if the instrument was `OptIn=false` -- including respecting other advisory parameters. Setting fields other than `enabled` on the View, including setting the `aggregation`, does not enable the instrument. From 9a96262eb252a93fe6c28f29c424d2edfd42e294 Mon Sep 17 00:00:00 2001 From: David Ashpole Date: Thu, 8 Jan 2026 20:59:04 +0000 Subject: [PATCH 11/12] lint --- specification/metrics/sdk.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/metrics/sdk.md b/specification/metrics/sdk.md index af8c520b881..8b281351291 100644 --- a/specification/metrics/sdk.md +++ b/specification/metrics/sdk.md @@ -417,7 +417,7 @@ The SDK MUST accept the following stream configuration parameters: * **Status**: [Development](../document-status.md) - `enabled` (optional): A boolean denoting whether the instrument should be enabled. When `enabled` is `false`, the View uses the `DropAggregation`, regardless of the `aggregation` - provided. If unset, the default is `true` unless the `OptIn` + provided. If unset, the default is `true` unless the `OptIn` parameter is `true`. #### Measurement processing From 6805ae295c478555983534c81002e17fceaa7124 Mon Sep 17 00:00:00 2001 From: David Ashpole Date: Wed, 28 Jan 2026 17:14:45 +0000 Subject: [PATCH 12/12] view stream.Enabled can be unset --- specification/metrics/sdk.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/specification/metrics/sdk.md b/specification/metrics/sdk.md index 8b281351291..96f5edccbf8 100644 --- a/specification/metrics/sdk.md +++ b/specification/metrics/sdk.md @@ -417,8 +417,10 @@ The SDK MUST accept the following stream configuration parameters: * **Status**: [Development](../document-status.md) - `enabled` (optional): A boolean denoting whether the instrument should be enabled. When `enabled` is `false`, the View uses the `DropAggregation`, regardless of the `aggregation` - provided. If unset, the default is `true` unless the `OptIn` - parameter is `true`. + provided. When `enabled` is `true` for an instrument with `OptIn` set to + `true`, the SDK treats the instrument as-if `OptIn` was set to false. The + SDK must allow `enabled` to be unset (neither true nor false). If unset, + `enabled` has no effect. #### Measurement processing