-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[processor/tailsampling] Support extensions #42573
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
Conversation
|
Welcome, contributor! Thank you for your contribution to opentelemetry-collector-contrib. Important reminders:
A maintainer will review your pull request soon. Thank you for helping make OpenTelemetry better! |
|
Welcome, contributor! Thank you for your contribution to opentelemetry-collector-contrib. Important reminders:
A maintainer will review your pull request soon. Thank you for helping make OpenTelemetry better! |
1618cfc to
d0fb27f
Compare
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/updated the extension will be called in order to create a new evaluator. 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, an object can defined under the "extension" key the policy config for anything related to one instance. This is useful when reusing the same extension e.g. different params for different services.
This matches all of the other policy types where the key for the
configuration matches the type of the policy. E.g. you configure
ottl_condition by setting ottl_condition: {...}
It can be useful for an instance of an evaluator to know the name of the policy for debugging or reporting purposes. Since a single type can be used multiple times with different configuration.
e8f1241 to
e6fe359
Compare
c435ece to
89593d7
Compare
89593d7 to
a3ea3df
Compare
|
@portertech please review as codeowner, thanks! |
|
This has codeowner approval now, anything else needed before merge? |
|
Thank you for your contribution @csmarchbanks! 🎉 We would like to hear from you about your experience contributing to OpenTelemetry by taking a few minutes to fill out this survey. |
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:
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.
Link to tracking issue
Part of #31582