Skip to content

feat(config): Add setting to skip processors before aggregators#19092

Open
calvinmachado20 wants to merge 14 commits into
influxdata:masterfrom
calvinmachado20:feature/skip_processors_before_aggregators
Open

feat(config): Add setting to skip processors before aggregators#19092
calvinmachado20 wants to merge 14 commits into
influxdata:masterfrom
calvinmachado20:feature/skip_processors_before_aggregators

Conversation

@calvinmachado20

@calvinmachado20 calvinmachado20 commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Addresses open issue: 17006

#14882 has introced the skip_processors_after_aggregators config option. Are there any plans to add a similar skip_processors_before_aggregators config option?

Expected behavior

Processors only run after the aggregators and are skipped before the aggregators.

Actual behavior

Manual workaround with adding, filtering and removing tags is required to achieve the above.

Checklist

Related issues

resolves #17006

@telegraf-tiger telegraf-tiger Bot added the feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin label Jun 12, 2026
@R290

R290 commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

I'd be happy to test this, but the Telegraf bot artifacts are missing due to a flaky test?

@calvinmachado20

Copy link
Copy Markdown
Contributor Author

Checking this

@calvinmachado20

Copy link
Copy Markdown
Contributor Author

@srebhan the failures appear to be flaky, how do you want to proceed here?

@calvinmachado20

Copy link
Copy Markdown
Contributor Author

@R290 the artifacts are generated, feel free to give this feature a run

@R290

R290 commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Behavior is expected. Setting both skip_processors_after_aggregators and skip_processors_before_aggregators to true, gives an error.

My test case consists of reading 2 metrics from file, one with field x and the other with field y. They are added together into field z with a Starlark processor. This only works if the metrics are merged beforehand with the merge aggregator. Setting skip_processors_before_aggregators to true results in the intended behavior.

@calvinmachado20

calvinmachado20 commented Jun 22, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for testing this out

@srebhan srebhan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for your contribution @calvinmachado20! Just one comment/question...

Comment thread agent/agent.go Outdated
@srebhan srebhan changed the title feat(config): Skip processors before aggregators feat(config): Add setting to skip processors before aggregators Jun 23, 2026
@srebhan srebhan self-assigned this Jun 23, 2026

@srebhan srebhan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @calvinmachado20!

One more thing: I think it's not good to mix config-related things into the agent code. So can we please check for the valid setup (we are not skipping before and after) as well as the conditionals to the config code just like SkipProcessorsAfterAggregators does it!?! I.e. we simply don't add processors to a.Config.Processors if SkipProcessorsBeforeAggregators is true...

This ensures that config related stuff is kept in config-land and does not sneak into the agent code.

@calvinmachado20 calvinmachado20 requested a review from srebhan June 25, 2026 18:58
@calvinmachado20

Copy link
Copy Markdown
Contributor Author

@srebhan thanks for the suggestion, completely agree with you, implemented the same

@calvinmachado20

Copy link
Copy Markdown
Contributor Author

@srebhan does this PR look good to go?

@srebhan srebhan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @calvinmachado20! I think you need to restore the warning!

Comment thread cmd/telegraf/cmd_config.go

@srebhan srebhan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the update @calvinmachado20! There are three more documentation placement comments from my side...

Comment thread docs/AGGREGATORS_AND_PROCESSORS.md Outdated
Comment thread docs/CONFIGURATION.md
Comment thread migrations/global_agent/testcases/default.conf
@calvinmachado20

Copy link
Copy Markdown
Contributor Author

@srebhan updated the docs as suggested

@calvinmachado20 calvinmachado20 requested a review from srebhan July 2, 2026 17:25
@telegraf-tiger

telegraf-tiger Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

@srebhan srebhan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice! Thanks a lot @calvinmachado20!

@srebhan srebhan added the ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. label Jul 3, 2026
@srebhan srebhan assigned skartikey and unassigned srebhan Jul 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/agent area/configuration feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants