From 6f360b11b1da3437139a516ff111955b62167ce3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Paj=C4=85k?= Date: Wed, 31 May 2023 19:29:37 +0200 Subject: [PATCH 1/7] Refine SDK MeterProvider configuration section --- specification/metrics/sdk.md | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/specification/metrics/sdk.md b/specification/metrics/sdk.md index f77c64db612..c1015726404 100644 --- a/specification/metrics/sdk.md +++ b/specification/metrics/sdk.md @@ -94,6 +94,19 @@ suggestions regarding how to implement this efficiently. The SDK SHOULD allow the creation of multiple independent `MeterProvider`s. +MeterProvider configuration (i.e. the passed [MetricExporters](#metricexporter), +[MetricReaders](#metricreader) and [Views](#view)) are owned by the `MeterProvider` +and the SDK MUST provide a way to configure all options that are implemented by +the SDK. This MAY be done at the time of MeterProvider creation if appropriate. + +The `MeterProvider` MAY provide methods to update the configuration. If +configuration is updated (e.g., adding a `MetricReader`), the updated +configuration MUST also apply to all already returned `Meters` (i.e. it MUST NOT +matter whether a `Meter` was obtained from the `MeterProvider` before or after +the configuration change). Note: Implementation-wise, this could mean that +`Meter` instances have a reference to their `MeterProvider` and access +configuration only via this reference. + ### Meter Creation New `Meter` instances are always created through a `MeterProvider` @@ -112,20 +125,6 @@ When a Schema URL is passed as an argument when creating a `Meter` the emitted telemetry for that `Meter` MUST be associated with the Schema URL, provided that the emitted data format is capable of representing such association. -Configuration (i.e., [MetricExporters](#metricexporter), -[MetricReaders](#metricreader) and [Views](#view)) MUST be managed solely by the -`MeterProvider` and the SDK MUST provide a way to configure all options that are -implemented by the SDK. This MAY be done at the time of MeterProvider creation -if appropriate. - -The `MeterProvider` MAY provide methods to update the configuration. If -configuration is updated (e.g., adding a `MetricReader`), the updated -configuration MUST also apply to all already returned `Meters` (i.e. it MUST NOT -matter whether a `Meter` was obtained from the `MeterProvider` before or after -the configuration change). Note: Implementation-wise, this could mean that -`Meter` instances have a reference to their `MeterProvider` and access -configuration only via this reference. - ### Shutdown This method provides a way for provider to do any cleanup required. From 2a23305e2a73927763dc3cd484b3c0469fcf2053 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Paj=C4=85k?= Date: Wed, 31 May 2023 19:34:04 +0200 Subject: [PATCH 2/7] Update sdk.md --- specification/metrics/sdk.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/specification/metrics/sdk.md b/specification/metrics/sdk.md index c1015726404..df913e9b0ab 100644 --- a/specification/metrics/sdk.md +++ b/specification/metrics/sdk.md @@ -95,9 +95,10 @@ suggestions regarding how to implement this efficiently. The SDK SHOULD allow the creation of multiple independent `MeterProvider`s. MeterProvider configuration (i.e. the passed [MetricExporters](#metricexporter), -[MetricReaders](#metricreader) and [Views](#view)) are owned by the `MeterProvider` -and the SDK MUST provide a way to configure all options that are implemented by -the SDK. This MAY be done at the time of MeterProvider creation if appropriate. +[MetricReaders](#metricreader) and [Views](#view)) are owned by the +`MeterProvider`. The SDK MUST provide a way to configure all options that are +implemented by the SDK. This MAY be done at the time of MeterProvider creation +if appropriate. The `MeterProvider` MAY provide methods to update the configuration. If configuration is updated (e.g., adding a `MetricReader`), the updated From a96269faf31f0558e125de8fd59d2bd3cfc40269 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Paj=C4=85k?= Date: Wed, 31 May 2023 19:44:35 +0200 Subject: [PATCH 3/7] Update sdk.md --- specification/metrics/sdk.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/specification/metrics/sdk.md b/specification/metrics/sdk.md index df913e9b0ab..6e3fad0b349 100644 --- a/specification/metrics/sdk.md +++ b/specification/metrics/sdk.md @@ -94,11 +94,10 @@ suggestions regarding how to implement this efficiently. The SDK SHOULD allow the creation of multiple independent `MeterProvider`s. -MeterProvider configuration (i.e. the passed [MetricExporters](#metricexporter), -[MetricReaders](#metricreader) and [Views](#view)) are owned by the -`MeterProvider`. The SDK MUST provide a way to configure all options that are -implemented by the SDK. This MAY be done at the time of MeterProvider creation -if appropriate. +MeterProvider configuration (i.e. [MetricExporters](#metricexporter), +[MetricReaders](#metricreader) and [Views](#view)) is owned by the +`MeterProvider`. The configuration MAY be applied at the time of MeterProvider +creation if appropriate. The `MeterProvider` MAY provide methods to update the configuration. If configuration is updated (e.g., adding a `MetricReader`), the updated From baf7e8e62b572ec14b3867308f6cf64a7f87eaf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Paj=C4=85k?= Date: Wed, 31 May 2023 19:50:14 +0200 Subject: [PATCH 4/7] Update sdk.md --- specification/metrics/sdk.md | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/specification/metrics/sdk.md b/specification/metrics/sdk.md index 6e3fad0b349..dab8e024939 100644 --- a/specification/metrics/sdk.md +++ b/specification/metrics/sdk.md @@ -94,19 +94,6 @@ suggestions regarding how to implement this efficiently. The SDK SHOULD allow the creation of multiple independent `MeterProvider`s. -MeterProvider configuration (i.e. [MetricExporters](#metricexporter), -[MetricReaders](#metricreader) and [Views](#view)) is owned by the -`MeterProvider`. The configuration MAY be applied at the time of MeterProvider -creation if appropriate. - -The `MeterProvider` MAY provide methods to update the configuration. If -configuration is updated (e.g., adding a `MetricReader`), the updated -configuration MUST also apply to all already returned `Meters` (i.e. it MUST NOT -matter whether a `Meter` was obtained from the `MeterProvider` before or after -the configuration change). Note: Implementation-wise, this could mean that -`Meter` instances have a reference to their `MeterProvider` and access -configuration only via this reference. - ### Meter Creation New `Meter` instances are always created through a `MeterProvider` @@ -125,6 +112,21 @@ When a Schema URL is passed as an argument when creating a `Meter` the emitted telemetry for that `Meter` MUST be associated with the Schema URL, provided that the emitted data format is capable of representing such association. +### Configuration + +Configuration (i.e. [MetricExporters](#metricexporter), +[MetricReaders](#metricreader) and [Views](#view)) MUST be owned by the +`MeterProvider`. The configuration MAY be applied at the time of MeterProvider +creation if appropriate. + +The `MeterProvider` MAY provide methods to update the configuration. If +configuration is updated (e.g., adding a `MetricReader`), the updated +configuration MUST also apply to all already returned `Meters` (i.e. it MUST NOT +matter whether a `Meter` was obtained from the `MeterProvider` before or after +the configuration change). Note: Implementation-wise, this could mean that +`Meter` instances have a reference to their `MeterProvider` and access +configuration only via this reference. + ### Shutdown This method provides a way for provider to do any cleanup required. From 56880d610335100db9b9277c752682dec84e18c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Paj=C4=85k?= Date: Wed, 31 May 2023 19:51:35 +0200 Subject: [PATCH 5/7] Update sdk.md --- 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 dab8e024939..cfb7577b1dc 100644 --- a/specification/metrics/sdk.md +++ b/specification/metrics/sdk.md @@ -116,7 +116,7 @@ that the emitted data format is capable of representing such association. Configuration (i.e. [MetricExporters](#metricexporter), [MetricReaders](#metricreader) and [Views](#view)) MUST be owned by the -`MeterProvider`. The configuration MAY be applied at the time of MeterProvider +`MeterProvider`. The configuration MAY be applied at the time of `MeterProvider` creation if appropriate. The `MeterProvider` MAY provide methods to update the configuration. If From 156f6c88afd520d019fdb1749ce1907b84a1fd35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Paj=C4=85k?= Date: Wed, 31 May 2023 19:55:35 +0200 Subject: [PATCH 6/7] Update sdk.md --- specification/metrics/sdk.md | 1 + 1 file changed, 1 insertion(+) diff --git a/specification/metrics/sdk.md b/specification/metrics/sdk.md index cfb7577b1dc..130ff9d9d2d 100644 --- a/specification/metrics/sdk.md +++ b/specification/metrics/sdk.md @@ -14,6 +14,7 @@ linkTitle: SDK - [MeterProvider](#meterprovider) * [MeterProvider Creation](#meterprovider-creation) * [Meter Creation](#meter-creation) + * [Configuration](#configuration) * [Shutdown](#shutdown) * [ForceFlush](#forceflush) * [View](#view) From 66a44917158a16921716163a183b898da6b73c05 Mon Sep 17 00:00:00 2001 From: Armin Ruech Date: Wed, 14 Jun 2023 16:29:16 +0200 Subject: [PATCH 7/7] Update CHANGELOG.md --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ff634ff573..3b9db4a4037 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,9 @@ release. ### Metrics +- Refine SDK MeterProvider configuration section. + ([#3522](/~https://github.com/open-telemetry/opentelemetry-specification/pull/3522)) + ### Logs ### Resource