Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sdk-*] remove mergeResourceWithDefaults option and align resource merging behavior with spec #5132

Open
4 tasks
pichlermarc opened this issue Nov 11, 2024 · 1 comment
Assignees
Labels
needs:code-contribution This feature/bug is ready to implement pkg:sdk-logs pkg:sdk-metrics pkg:sdk-node pkg:sdk-trace-base target:next-major-release This PR targets the next major release (`next` branch) type:feature A feature with no sub-issues to address

Comments

@pichlermarc
Copy link
Member

pichlermarc commented Nov 11, 2024

Description

Our previous implementation of resource merging in SDKs was not compliant with the specification, which states that:

The SDK MUST provide access to a Resource with at least the attributes listed at
Semantic Attributes with SDK-provided Default Value.
This resource MUST be associated with a TracerProvider or MeterProvider
if another resource was not explicitly specified.

Our implementation always merged the default resource, regardless of the user supplying their own so there was no way to set an empty resource explicitly. Since simply changing the behavior would've broken too many users that rely on the non-secification compliant behavior, we opted to add a flag (mergeResourceWithDefaults in #4617) that would allow users to opt-in to the specification compliant behavior instead.

The goal of this issue is to remove the option from all SDKs (and sdk-node) AND align the behavior with the specification (meaning: only merging when the user does NOT provide a resource)

This issue is considered done when:

Additional requirements

  • Make sure to adjust tests and remove tests that are not needed anymore

Additional context

@pichlermarc pichlermarc added pkg:sdk-metrics pkg:sdk-node pkg:sdk-trace-base needs:refinement This issue needs to be refined/broken apart into sub-issues before implementation type:feature A feature with no sub-issues to address pkg:sdk-logs target:next-major-release This PR targets the next major release (`next` branch) blocked Currently blocked on another item labels Nov 11, 2024
@pichlermarc pichlermarc added this to the OpenTelemetry SDK 2.0 milestone Nov 11, 2024
@pichlermarc pichlermarc changed the title [sdk-*] remove mergeResourceWithDefaults option [sdk-*] remove mergeResourceWithDefaults option and align resource merging behavior with spec Nov 11, 2024
@pichlermarc pichlermarc added needs:code-contribution This feature/bug is ready to implement and removed blocked Currently blocked on another item needs:refinement This issue needs to be refined/broken apart into sub-issues before implementation labels Nov 15, 2024
@david-luna david-luna self-assigned this Nov 28, 2024
@david-luna
Copy link
Contributor

I'm working on a PR for this one :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs:code-contribution This feature/bug is ready to implement pkg:sdk-logs pkg:sdk-metrics pkg:sdk-node pkg:sdk-trace-base target:next-major-release This PR targets the next major release (`next` branch) type:feature A feature with no sub-issues to address
Projects
None yet
Development

No branches or pull requests

2 participants