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 extensions (#42573)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
Allow the Tail Sampling Processor to use extensions that implement an
interface simply containing NewEvaluator. To use an extension all that
needs to be done is specify the extension's type/name such as
my_extension or my_extension/my_name in the type field of the policy
configuration. When configuration is loaded or updated NewEvaluator will
be called.
Extensions can be configured in two places. First, in the extensions
section like all other extensions. This is useful for configuration such
as if an extension needs to connect to an external service. In addition,
configuration can be defined in the policy config under a key matching
the type of the extension for anything related to one instance,
following the pattern for all other policy types. This is useful when
reusing the same extension e.g. different params for different services.
For example:
```yaml
type: custom_policy
custom_policy:
foo: bar
```
What this ends up with is that extensions look exactly like all other
policy types with no need for users to know about some sort of extension
container.
I have tested this out with an extension in a custom build and it is
working well, I am sure we will iterate on the interfaces a bit as we
write more. Specifically a way to stop the extension when policies are
updated may be necessary to clean up any background processes. @yvrhdn
is working on an extension we plan to add to contrib as well.
<!-- Issue number (e.g. #1234) or full URL to issue, if applicable. -->
#### Link to tracking issue
Part of
#31582
0 commit comments