-
Notifications
You must be signed in to change notification settings - Fork 123
[FileBasedConfiguration] Propagators Configuration #4482
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
[FileBasedConfiguration] Propagators Configuration #4482
Conversation
| [YamlMember(Alias = "composite_list")] | ||
| public string? CompositeList { get; set; } | ||
|
|
||
| public IReadOnlyList<Propagator> GetEnabledPropagators() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
Distinct()already does the HashSet logic for you, no need to be explicit. -
return early >
if (Composite is null && string.IsNullOrEmpty(CompositeList))
{
return Array.Empty<Propagator>();
}
-
ToLowerInvariant() adds extra string allocation. Maybe you can reuse
StringComparison.InvariantCultureIgnoreCasebased logic. -
Try to verify the list and not to copy it's contents over to another.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in a19d41f
ToLowerInvariant() adds extra string allocation. Maybe you can reuse StringComparison.InvariantCultureIgnoreCase based logic.
I made it case-sensitive, as it was done in OTEL_PROPAGATORS.
| { | ||
| var config = new PropagatorConfiguration | ||
| { | ||
| CompositeList = "invalid,b3multi" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Empty test here?
| CompositeList = "invalid,b3multi" | |
| CompositeList = "invalid,b3multi," |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactored test with load to settings 62af6ff
| Constants.ConfigurationValues.Propagators.W3CBaggage => Propagator.W3CBaggage, | ||
| Constants.ConfigurationValues.Propagators.B3Multi => Propagator.B3Multi, | ||
| Constants.ConfigurationValues.Propagators.B3Single => Propagator.B3Single, | ||
| _ => null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this legal? what is the result, NoOpPropagator etc?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it is legal.
Added a test for the Noop Propagator 62af6ff
Why
Towards #4394
Extracted and refactored from #4270
What
File based configuration for propagators
Tests
CI
Checklist
CHANGELOG.mdis updated.