-
Notifications
You must be signed in to change notification settings - Fork 97
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: extract key fields from rules config #1327
Conversation
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.
Overall looks good - left some feedback for the new interface and how we extract the sampler fields.
@@ -149,10 +149,22 @@ type V2SamplerConfig struct { | |||
Samplers map[string]*V2SamplerChoice `json:"samplers" yaml:"Samplers,omitempty" validate:"required"` | |||
} | |||
|
|||
type GetSamplingFielder interface { |
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.
Should we call this interface SamplerConfig
instead as it's implemented by all sampler configs? If we need to introduce other shared functionality in the future, it enables us to add more shared logic without adding more interfaces.
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.
The reason why I chose this name is bc it's easy to know the intend of this interface. If in the future we find ourselves needing to implement more common method for SamplerConfigs, we can have a name reflect those methods. SamplerConfig
in a bit too generic to know what exactly the interface is trying to achieve from my perspective
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.
Sure, it's an internal interface so isn't that important if have to change it in the future. I guess it depends on which side of generic vs specific interface you. As a generic interface that all sample implementations will need to implement, I prefer SamplerConfig. If it were only going to be implemented on a subset of samplers, a more discrete name is better.
Either way, happy to continue with it's current name and we can change later if we need to 😄
## Which problem is this PR solving? Extract sampling fields from config so that we can use it to construct key fields only spans fixes: #1325 ## Short description of the changes - add `GetSamplingFielder` interface to sampler config - add `GetKeyFields` to all samplers
Which problem is this PR solving?
Extract sampling fields from config so that we can use it to construct key fields only spans
fixes: #1325
Short description of the changes
GetSamplingFielder
interface to sampler configGetKeyFields
to all samplers