Skip to content
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

feat(agent): Allow separators for namepass and namedrop filters #14361

Merged
merged 7 commits into from
Nov 30, 2023

Conversation

akash-rubrik
Copy link
Contributor

@akash-rubrik akash-rubrik commented Nov 28, 2023

Required for all PRs

resolves #14056

@telegraf-tiger
Copy link
Contributor

Thanks so much for the pull request!
🤝 ✒️ Just a reminder that the CLA has not yet been signed, and we'll need it before merging. Please sign the CLA when you get a chance, then post a comment here saying !signed-cla

@akash-rubrik akash-rubrik changed the title Glob separators feat: Allow adding separators for namepass and namedrop filters in the input config Nov 28, 2023
@akash-rubrik
Copy link
Contributor Author

!signed-cla

@akash-rubrik
Copy link
Contributor Author

@srebhan can you help review this?

@srebhan srebhan changed the title feat: Allow adding separators for namepass and namedrop filters in the input config feat(agent): Allow separators for namepass and namedrop filters Nov 28, 2023
@srebhan srebhan self-assigned this Nov 28, 2023
@srebhan srebhan added feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin area/configuration area/agent labels Nov 28, 2023
Copy link
Member

@srebhan srebhan left a comment

Choose a reason for hiding this comment

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

Thanks for the nice and comprehensive PR @akash-rubrik! Especially for the unit-test!!! Just have two minor comments...

filter/filter.go Outdated Show resolved Hide resolved
config/config.go Outdated Show resolved Hide resolved
Copy link
Member

@srebhan srebhan left a comment

Choose a reason for hiding this comment

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

Thanks for the update @akash-rubik! This was exactly what I meant. I have two small formatting comments and a request to leave existing tests as-is to also test backward-compatibility. We are very close IMO...

Comment on lines 3 to 5
namepass = ["metricname1"]
namepass_separator = "."
namedrop = ["metricname2"]
namedrop_separator = "."
fieldpass = ["some", "strings"]
Copy link
Member

Choose a reason for hiding this comment

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

Can you please leave existing tests as they were!? We usually use them as a guarantee for backward-compatibility... Same for the other toml files below. If you want to test something, just add a new config or test.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

makes sense, done

docs/CONFIGURATION.md Outdated Show resolved Hide resolved
docs/CONFIGURATION.md Outdated Show resolved Hide resolved
@Hipska Hipska self-assigned this Nov 30, 2023
Copy link
Contributor

@Hipska Hipska left a comment

Choose a reason for hiding this comment

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

Thanks for this feature. The only thing I'm wondering is if there is any scenario you would have a different separator for Pass or for Drop? It looks a bit too much to have 2 separate config items for that..

@Hipska Hipska removed their assignment Nov 30, 2023
@telegraf-tiger
Copy link
Contributor

@akash-rubrik
Copy link
Contributor Author

Thanks for this feature. The only thing I'm wondering is if there is any scenario you would have a different separator for Pass or for Drop? It looks a bit too much to have 2 separate config items for that..

Fair point, I just didn't want to make it confusing and cause any unintended effects. So providing more customizability seemed the best option.

Copy link
Member

@srebhan srebhan left a comment

Choose a reason for hiding this comment

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

Awesome! Thanks for your contribution @akash-rubrik!

@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 Nov 30, 2023
@srebhan srebhan assigned powersj and unassigned srebhan Nov 30, 2023
Copy link
Contributor

@powersj powersj left a comment

Choose a reason for hiding this comment

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

Thank you!

@powersj powersj merged commit 761dbce into influxdata:master Nov 30, 2023
23 checks passed
@github-actions github-actions bot added this to the v1.29.0 milestone Nov 30, 2023
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.

Allow specifying separators while using glob match for filtering
4 participants