From ea509c7a5313740d66d33759f1eed63344b5e809 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Neum=C3=BCller?= Date: Fri, 15 Jan 2021 12:13:45 +0100 Subject: [PATCH 1/4] Make Resource.Merge consistent with Span.SetAttribute. --- specification/resource/sdk.md | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/specification/resource/sdk.md b/specification/resource/sdk.md index 85e7e9b1e20..d0c16c9a87c 100644 --- a/specification/resource/sdk.md +++ b/specification/resource/sdk.md @@ -43,27 +43,21 @@ Required parameters: ### Merge -The interface MUST provide a way for a primary resource and a -secondary resource to be merged into a new resource. +The interface MUST provide a way for a old resource and a +updating resource to be merged into a new resource. Note: This is intended to be utilized for merging of resources whose attributes come from different sources, such as environment variables, or metadata extracted from the host or container. The resulting resource MUST have all attributes that are on any of the two input resources. -Conflicts (i.e. a key for which attributes exist on both the primary and secondary resource) -MUST be handled as follows: - -* If the value on the primary resource is an empty string, the result has the value of the secondary resource. -* Otherwise, the value of the primary resource is used. - -Attribute key namespacing SHOULD be used to prevent collisions across different -resource detection steps. +If a key exists on both the old and updating resource, the value of the updating +resource MUST be picked (even if the updated value is empty). Required parameters: -- the primary resource whose attributes take precedence. -- the secondary resource whose attributes will be merged in. +- the old resource +- the updating resource whose attributes take precedence ### The empty resource From 5c3fcb58f0ba315a2f0fc26e80aa2bacebd3623f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Neum=C3=BCller?= Date: Fri, 15 Jan 2021 12:17:30 +0100 Subject: [PATCH 2/4] Update CHANGELOG, compliance-matrix. --- CHANGELOG.md | 3 +++ spec-compliance-matrix.md | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 50aca1edc50..7d1cd43b8a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,6 +39,9 @@ Updates: ([#1322](https://github.com/open-telemetry/opentelemetry-specification/pull/1322)) - Require schemed endpoints for OTLP exporters ([1234](https://github.com/open-telemetry/opentelemetry-specification/pull/1234)) +- Resource SDK: Reverse (suggested) order of Resource.Merge parameters, remove + special case for empty strings + ([#????](https://github.com/open-telemetry/opentelemetry-specification/pull/????)) ## v0.7.0 (11-18-2020) diff --git a/spec-compliance-matrix.md b/spec-compliance-matrix.md index 04ab5726873..fb35872a4fc 100644 --- a/spec-compliance-matrix.md +++ b/spec-compliance-matrix.md @@ -90,7 +90,7 @@ status of the feature is not known. |----------------------------------------------|---|----|---|------|----|------|---|----|---|----|-----| |Create from Attributes | + | + | + | + | + | + | | + | | + | + | |Create empty | + | + | + | + | + | + | | + | | + | + | -|Merge | + | + | + | + | + | + | | + | | + | + | +|[Merge (v2)](specification/resource/sdk.md#merge) | | | | | | | | | | | | |Retrieve attributes | + | + | + | + | + | + | | + | | + | + | |[Default value](specification/resource/semantic_conventions/README.md#attributes-with-default-value) for service.name | | | | | | | | | | | | From 39fafa5568d8479920fe7048cd02ed97d3ffdce0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Neum=C3=BCller?= Date: Fri, 15 Jan 2021 13:10:53 +0100 Subject: [PATCH 3/4] Fill in PR#. --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d1cd43b8a0..1c681117836 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,7 +41,7 @@ Updates: ([1234](https://github.com/open-telemetry/opentelemetry-specification/pull/1234)) - Resource SDK: Reverse (suggested) order of Resource.Merge parameters, remove special case for empty strings - ([#????](https://github.com/open-telemetry/opentelemetry-specification/pull/????)) + ([#1345](https://github.com/open-telemetry/opentelemetry-specification/pull/1345)) ## v0.7.0 (11-18-2020) From 7963e9892a7811b6ae5093d20cbe87ca459b3c8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Neum=C3=BCller?= Date: Fri, 15 Jan 2021 14:27:22 +0100 Subject: [PATCH 4/4] Update specification/resource/sdk.md --- specification/resource/sdk.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/resource/sdk.md b/specification/resource/sdk.md index d0c16c9a87c..bcc2871fee1 100644 --- a/specification/resource/sdk.md +++ b/specification/resource/sdk.md @@ -43,7 +43,7 @@ Required parameters: ### Merge -The interface MUST provide a way for a old resource and a +The interface MUST provide a way for an old resource and an updating resource to be merged into a new resource. Note: This is intended to be utilized for merging of resources whose attributes