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

Add file configuration ComponentProvider support for resources #6625

Merged
merged 3 commits into from
Aug 28, 2024

Conversation

jack-berg
Copy link
Member

@jack-berg jack-berg commented Aug 6, 2024

Related to #6574.

In the issue, I said this about resources:

For resources, should likely add support for ResourceProvider instead of loading via ComponentProvider since ResourceDeteector is already a first class concept in the specification, and ResourceProvider is the java implementation of ResourceDetector.

I had a change of heart in the implementation. Implementations of ResourceProvider expect to be participating in a configuration scenario which is based on the env var / system property configuration scheme. They receive a ConfigProperties instead of the StructuredConfigProperties used in file config, and look for things in it like otel.resource.attributes and otel.service.name to influence their behavior.

Instead, in this PR I use ComponentProvider to provide resource attributes. This will require me to go and update the various resource provider artifacts and implement ComponentProvider, but will be more precise, and more consistent with the clean separation approach we've been taking with file configuration.

Copy link

codecov bot commented Aug 6, 2024

Codecov Report

Attention: Patch coverage is 88.23529% with 4 lines in your changes missing coverage. Please review.

Project coverage is 90.18%. Comparing base (e8b50c6) to head (0f006d0).
Report is 29 commits behind head on main.

Files with missing lines Patch % Lines
...xtension/incubator/fileconfig/ResourceFactory.java 88.23% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##               main    #6625   +/-   ##
=========================================
  Coverage     90.18%   90.18%           
- Complexity     6259     6267    +8     
=========================================
  Files           697      697           
  Lines         18871    18901   +30     
  Branches       1843     1847    +4     
=========================================
+ Hits          17018    17046   +28     
- Misses         1282     1285    +3     
+ Partials        571      570    -1     

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

@jack-berg jack-berg merged commit 05fe136 into open-telemetry:main Aug 28, 2024
18 checks passed
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.

2 participants