You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[processor/tailsampling] Support hot sampling policy loading (#37014)
#### Description
Adding a feature. This pull-request adds support for hot sampling policy
loading to the tail sampling processor. This allows the collector (or
another service using the processor) to dynamically update tail sampling
policy without needing to restart the processor (or the entire
collector). This greatly minimizes the impact of sampling policy
modifications on pipeline availability and processing. Changes to policy
are safely applied on the next tick loop.
A collector (and/or other service) could use OpAMP to remotely manage
sampling policy with little to no negative impact on pipeline
availability and performance. This is what the https://tailctrl.io/
agent did.
#### Usage
Currently need to define a custom interface in order to set sampling
policy.
``` go
type SamplingProcessor interface {
processor.Traces
SetSamplingPolicy(cfgs []tailsamplingprocessor.PolicyCfg)
}
factory := tailsamplingprocessor.NewFactory()
tsp, _ := factory.CreateTraces()
sp = tsp.(SamplingProcessor)
sp.SetSamplingPolicy(cfgs)
```
#### Testing
Added a test to ensure changes to policy are loaded. Using the changes
in a private project.
---------
Signed-off-by: Sean Porter <[email protected]>
Co-authored-by: Matthew Wear <[email protected]>
0 commit comments