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

feat(resources): use functions over constants for default and empty resources #5467

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

pichlermarc
Copy link
Member

Which problem is this PR solving?

My suggestion from #5421 (comment) - using functions over constants to create an empty or default resource, aligning with the other factory function resourceFromAttributes

Fixes # (issue)

Type of change

  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

How Has This Been Tested?

  • Unit tests

Copy link

codecov bot commented Feb 13, 2025

Codecov Report

Attention: Patch coverage is 81.25000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 94.94%. Comparing base (1a5b57b) to head (d1fe6f6).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...ntelemetry-browser-detector/src/BrowserDetector.ts 0.00% 2 Missing ⚠️
...es/opentelemetry-resources/src/detect-resources.ts 50.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5467   +/-   ##
=======================================
  Coverage   94.94%   94.94%           
=======================================
  Files         309      309           
  Lines        8017     8019    +2     
  Branches     1701     1701           
=======================================
+ Hits         7612     7614    +2     
  Misses        405      405           
Files with missing lines Coverage Δ
...imental/packages/opentelemetry-sdk-node/src/sdk.ts 96.01% <100.00%> (ø)
...perimental/packages/sdk-logs/src/LoggerProvider.ts 97.77% <100.00%> (ø)
...es/shim-opencensus/src/OpenCensusMetricProducer.ts 100.00% <100.00%> (ø)
...ckages/opentelemetry-resources/src/ResourceImpl.ts 98.33% <100.00%> (+0.05%) ⬆️
...elemetry-sdk-trace-base/src/BasicTracerProvider.ts 95.58% <100.00%> (ø)
packages/sdk-metrics/src/MeterProvider.ts 100.00% <100.00%> (ø)
...es/opentelemetry-resources/src/detect-resources.ts 85.00% <50.00%> (ø)
...ntelemetry-browser-detector/src/BrowserDetector.ts 13.33% <0.00%> (ø)

@pichlermarc pichlermarc marked this pull request as ready for review February 13, 2025 17:23
@pichlermarc pichlermarc requested a review from a team as a code owner February 13, 2025 17:23
@pichlermarc pichlermarc added the target:next-major-release This PR targets the next major release (`next` branch) label Feb 13, 2025
@pichlermarc pichlermarc added this to the OpenTelemetry SDK 2.0 milestone Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
target:next-major-release This PR targets the next major release (`next` branch)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants