Skip to content

Conversation

@franciscovalentecastro
Copy link
Contributor

@franciscovalentecastro franciscovalentecastro commented Jun 25, 2025

Description

Create With*Functions factory options to provide custom OTTL functions for logs, metrics or traces to the resulting processor. Also created the "exported" Default*Functions functions that can be used to provide a "subset" of the default functions used in the filter processor.

Some details and context about this PR :

Usage

The factory options can be used like the following example :

NewFactoryWithOptions(
	WithLogFunctions(filterprocessor.DefaultLogFunctions()),
	WithLogFunctions([]ottl.Factory[ottllog.TransformContext]{FunctionOne, FunctionTwo, ...}),
	WithLogFunctions([]ottl.Factory[ottllog.TransformContext]{FunctionThree, FunctionFour, ...}),
)

Link to tracking issue

Testing

  • Added unit tests for the modified methods and functions.

Documentation

  • Added comments to the new With*Functions, Default*Functions and NewFactoryWithOptions functions.

@franciscovalentecastro
Copy link
Contributor Author

franciscovalentecastro commented Jul 7, 2025

Following up the review request @TylerHelmuth @boostchicken @mwear.

@franciscovalentecastro franciscovalentecastro force-pushed the fcovalente-filterprocessor-with-functions branch from a07bfeb to 3062e8d Compare July 11, 2025 17:25
@franciscovalentecastro franciscovalentecastro force-pushed the fcovalente-filterprocessor-with-functions branch from 928345a to 237452d Compare July 28, 2025 20:35
@franciscovalentecastro franciscovalentecastro force-pushed the fcovalente-filterprocessor-with-functions branch from 6e9cc1c to 96da8a7 Compare August 6, 2025 21:39
Copy link
Contributor

@edmocosta edmocosta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good to me. API is consistent with the transform processor one (#39698), and it worked well on my local tests. Great work @franciscovalentecastro!

@evan-bradley, you might be interested on taking a look at this one considering you also reviewed the transform processor changes :)

@franciscovalentecastro franciscovalentecastro force-pushed the fcovalente-filterprocessor-with-functions branch from 497562d to 596d223 Compare August 15, 2025 03:00
@mwear mwear added ready to merge Code review completed; ready to merge by maintainers and removed waiting-for-code-owners labels Aug 22, 2025
Copy link
Contributor

@evan-bradley evan-bradley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delayed review, this looks good to me. Thanks for your patience @franciscovalentecastro.

@evan-bradley evan-bradley merged commit 93caa93 into open-telemetry:main Aug 25, 2025
186 checks passed
@github-actions github-actions bot added this to the next release milestone Aug 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

processor/filter Filter processor ready to merge Code review completed; ready to merge by maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[processor/filter] Register programatically custom OTTL funcs in the filter processor.

5 participants