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 Scheme to MapProvider interface #5068

Merged
merged 2 commits into from
Apr 4, 2022

Conversation

bogdandrutu
Copy link
Member

This is another required step in order to support configuring map providers via the Builder.

Updates #4759

This is a breaking change, since adds a new func to an interface. It is hard to make this backwards compatible, and would like to move forward with this exception.

Signed-off-by: Bogdan Drutu bogdandrutu@gmail.com

@codecov
Copy link

codecov bot commented Mar 23, 2022

Codecov Report

Merging #5068 (c6a015f) into main (46e9040) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #5068   +/-   ##
=======================================
  Coverage   90.33%   90.33%           
=======================================
  Files         182      182           
  Lines       11024    11032    +8     
=======================================
+ Hits         9958     9966    +8     
  Misses        841      841           
  Partials      225      225           
Impacted Files Coverage Δ
config/mapprovider/envmapprovider/mapprovider.go 100.00% <100.00%> (ø)
config/mapprovider/filemapprovider/mapprovider.go 84.21% <100.00%> (+1.85%) ⬆️
config/mapprovider/yamlmapprovider/mapprovider.go 100.00% <100.00%> (ø)
service/config_provider.go 94.33% <100.00%> (+0.10%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 46e9040...c6a015f. Read the comment docs.

This is another required step in order to support configuring map providers via the Builder.

Updates open-telemetry#4759

This is a breaking change, since adds a new func to an interface. It is hard to make this backwards compatible, and would like to move forward with this exception.

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
Copy link
Member

@mx-psi mx-psi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I find this to be an acceptable breakage of the rules (but would like to hear from at least one other approver)

@dmitryax
Copy link
Member

Seems reasonable to me as well

@tigrannajaryan
Copy link
Member

tigrannajaryan commented Mar 24, 2022

Does Scheme() need to be part of MapProvider interface? I see an analogy with components where we made Type part of the component factory, not of the component instance itself. Using this same approach we can introduce MapProviderFactory that would know the Scheme and then would allow creating MapProviders in MustNewDefaultConfigProvider.

@bogdandrutu
Copy link
Member Author

I see an analogy with components where we made Type part of the component factory, not of the component instance itself.

I have a different view of this, kind of the MapProvider is the equivalent of the Factory and the Retrieved value is the component.

@tigrannajaryan
Copy link
Member

I see an analogy with components where we made Type part of the component factory, not of the component instance itself.

I have a different view of this, kind of the MapProvider is the equivalent of the Factory and the Retrieved value is the component.

Yeah, I guess that works too. The factory-based approach would probably be a bit more uniform with what we do with components from naming perspective, but I think your approach is fine too.

@bogdandrutu bogdandrutu merged commit 1c3be5d into open-telemetry:main Apr 4, 2022
Nicholaswang pushed a commit to Nicholaswang/opentelemetry-collector that referenced this pull request Jun 7, 2022
This is another required step in order to support configuring map providers via the Builder.

Updates open-telemetry#4759

This is a breaking change, since adds a new func to an interface. It is hard to make this backwards compatible, and would like to move forward with this exception.

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>

Co-authored-by: Alex Boten <aboten@lightstep.com>
@bogdandrutu bogdandrutu deleted the scheme branch October 14, 2024 20:28
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.

5 participants