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/add resource builder #2322

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

Conversation

pitoniak32
Copy link
Contributor

@pitoniak32 pitoniak32 commented Nov 22, 2024

fixes #2320

Changes

  • Removing the timeout field for ResourceDetectors.
  • Add ResourceBuilder to more easily create resources.

example usage:

let resource = Resource::builder()
    .with_detector(Box::new(EnvResourceDetector::new()))
    .with_key_value(KeyValue::new("test1", "test_value"))
    .with_key_values(vec![
        KeyValue::new("test1", "test_value1"),
        KeyValue::new("test2", "test_value2"),
    ])
    .build();

Merge requirement checklist

  • CONTRIBUTING guidelines followed
  • Unit tests added/updated (if applicable)
  • Appropriate CHANGELOG.md files updated for non-trivial, user-facing changes
  • Changes in public API reviewed (if applicable)

@pitoniak32 pitoniak32 requested a review from a team as a code owner November 22, 2024 01:30
Copy link

codecov bot commented Nov 22, 2024

Codecov Report

Attention: Patch coverage is 89.41176% with 9 lines in your changes missing coverage. Please review.

Project coverage is 79.5%. Comparing base (8c9babb) to head (afb8ba4).

Files with missing lines Patch % Lines
opentelemetry-sdk/src/resource/builder.rs 91.6% 5 Missing ⚠️
opentelemetry-sdk/src/resource/mod.rs 78.5% 3 Missing ⚠️
opentelemetry-zipkin/src/exporter/mod.rs 0.0% 1 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff          @@
##            main   #2322   +/-   ##
=====================================
  Coverage   79.5%   79.5%           
=====================================
  Files        123     124    +1     
  Lines      21295   21355   +60     
=====================================
+ Hits       16935   16987   +52     
- Misses      4360    4368    +8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

@pitoniak32
Copy link
Contributor Author

I still need to expose the new builder to the API, and would like feedback on #2324 before going further since the changes are related :)

@utpilla
Copy link
Contributor

utpilla commented Nov 23, 2024

@pitoniak32 Could you split this into two PRs? Have one PR just for removing the timeout argument and one for resource builder. That way we can merge the timeout related PR while we review the builder related changes.

@pitoniak32
Copy link
Contributor Author

@pitoniak32 Could you split this into two PRs? Have one PR just for removing the timeout argument and one for resource builder. That way we can merge the timeout related PR while we review the builder related changes.

split those changes into: #2332

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve Resource related public APIs
2 participants