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

config: add support for configuring propagators #6727

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

Conversation

jpkrohling
Copy link
Member

Fixes #6712

@jpkrohling jpkrohling requested review from pellared and a team as code owners February 6, 2025 11:40
@github-actions github-actions bot requested a review from codeboten February 6, 2025 11:41
Copy link

codecov bot commented Feb 6, 2025

Codecov Report

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

Project coverage is 74.5%. Comparing base (d21dd87) to head (7d7a2fc).

Files with missing lines Patch % Lines
config/v0.3.0/config.go 57.1% 2 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##            main   #6727     +/-   ##
=======================================
- Coverage   74.5%   74.5%   -0.1%     
=======================================
  Files        199     200      +1     
  Lines      17529   17551     +22     
=======================================
+ Hits       13075   13091     +16     
- Misses      4070    4074      +4     
- Partials     384     386      +2     
Files with missing lines Coverage Δ
config/v0.3.0/propagation.go 100.0% <100.0%> (ø)
propagators/autoprop/registry.go 100.0% <100.0%> (ø)
config/v0.3.0/config.go 86.1% <57.1%> (-2.4%) ⬇️

... and 1 file with indirect coverage changes

config/v0.3.0/config.go Outdated Show resolved Hide resolved
config/v0.3.0/config.go Outdated Show resolved Hide resolved
config/v0.3.0/propagation.go Outdated Show resolved Hide resolved
config/v0.3.0/config.go Outdated Show resolved Hide resolved
@pellared
Copy link
Member

pellared commented Feb 6, 2025

Changelog entry is missing.

Copy link
Contributor

@codeboten codeboten left a comment

Choose a reason for hiding this comment

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

Thanks for taking on this work @jpkrohling! Added a couple of comments

config/v0.3.0/propagation.go Outdated Show resolved Hide resolved
return propagation.NewCompositeTextMapPropagator(ps...), nil
}

func propagatorByName(name string) (propagation.TextMapPropagator, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

It might be possible to simplify the code here by using the autoprop package

Copy link
Member

Choose a reason for hiding this comment

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

Given the second reviewer says the same I think this could be addressed

Reference: #6727 (comment)

Copy link
Member Author

Choose a reason for hiding this comment

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

Done! I'm not sure the current code justifies a new function and new source file. On the other hand, it's aligned with how things are done for similar constructs. I think I prefer this way, but I don't have strong opinions.

@jpkrohling jpkrohling requested a review from MrAlias as a code owner February 7, 2025 12:57
Signed-off-by: Juraci Paixão Kröhling <[email protected]>
Signed-off-by: Juraci Paixão Kröhling <[email protected]>
Signed-off-by: Juraci Paixão Kröhling <[email protected]>
Signed-off-by: Juraci Paixão Kröhling <[email protected]>
@jpkrohling jpkrohling force-pushed the jpkrohling/issue6712 branch from 3448a6c to 1440ce9 Compare February 7, 2025 13:01
@jpkrohling
Copy link
Member Author

Note: I changed a couple of things in autoprop, to account for two edge cases: an empty input, which IMO should have the same behavior as if the value wasn't specified), and an empty value, which IMO should be skipped.

Signed-off-by: Juraci Paixão Kröhling <[email protected]>
Signed-off-by: Juraci Paixão Kröhling <[email protected]>
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.

config: add support for configuring propagators
3 participants