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

[Fleet] Improve validation for dynamic Kafka topics #212422

Merged

Conversation

Supplementing
Copy link
Contributor

@Supplementing Supplementing commented Feb 25, 2025

Closes #206194

Summary

Screen.Recording.2025-02-26.at.7.30.18.AM.mov
  • Removed hardcoded wrapping of user-entered topics with %{[]} to fix issues arising from the user pre-wrapping, and also allow greater flexibility in naming
  • Added validation rules to check for unclosed brackets & brackets with missing % preceding
  • Added the auto-wrapping to the value field of items chosen from the dropdown to ensure they were always wrapped as intended
  • Added test coverage for validating dynamic topics

Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

  • Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support
  • Documentation was added for features that require explanation or tutorials
  • Unit or functional tests were updated or added to match the most common scenarios
  • If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the docker list
  • This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The release_note:breaking label should be applied in these situations.
  • Flaky Test Runner was used on any tests changed
  • The PR description includes the appropriate Release Notes section, and the correct release_note:* label is applied per the guidelines

Identify risks

n/a

@Supplementing Supplementing requested a review from a team as a code owner February 25, 2025 17:21
@Supplementing Supplementing added release_note:skip Skip the PR/issue when compiling release notes backport:skip This commit does not require backporting Team:Fleet Team label for Observability Data Collection Fleet team labels Feb 25, 2025
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@Supplementing
Copy link
Contributor Author

@elasticmachine merge upstream

@Supplementing Supplementing enabled auto-merge (squash) February 25, 2025 21:15
@kpollich
Copy link
Member

Looking at the dropdown I wonder if we can change the "not recommended" text. I don't think we need to explicitly discourage the dynamic topic syntax like that.

@Supplementing
Copy link
Contributor Author

Looking at the dropdown I wonder if we can change the "not recommended" text. I don't think we need to explicitly discourage the dynamic topic syntax like that.

I agree, it does make it feel like you're 'doing something wrong', when its really just a more 'advanced option' than inherently wrong, or to be discouraged.

@Supplementing
Copy link
Contributor Author

@kpollich Also, do you think its worth maybe linking to the docs somewhere in the UI with it being a little bit more advanced and prone to user error? If so, @criamico mentioned it in the issue, but the docs dont explicitly lay out the multi-format string as being an option, so we likely need to get those up-to-date as well.

@kpollich
Copy link
Member

@kpollich Also, do you think its worth maybe linking to the docs somewhere in the UI with it being a little bit more advanced and prone to user error? If so, @criamico mentioned it in the issue, but the docs dont explicitly lay out the multi-format string as being an option, so we likely need to get those up-to-date as well.

Yeah we can link to those docs and probably file an issue in https://github.com/elastic/ingest-docs to get those filebeat docs updated to go into more detail about the dynamic topic syntax.

Copy link
Member

@kpollich kpollich left a comment

Choose a reason for hiding this comment

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

One last thing to update and this will be good to go from me

@Supplementing Supplementing requested a review from a team as a code owner February 27, 2025 12:37
Copy link
Member

@kpollich kpollich left a comment

Choose a reason for hiding this comment

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

Awesome work 🚀

@kilfoyle
Copy link
Contributor

kilfoyle commented Feb 27, 2025

Yeah we can link to those docs and probably file an issue in https://github.com/elastic/ingest-docs to get those filebeat docs updated to go into more detail about the dynamic topic syntax.

@kpollich I hope it's okay: I transferred this docs issue into the beats repo (elastic/beats#42932) since (as far as I know) the ingest-docs repo has been used only for Fleet & Elastic Agent updates. This may all change soon though with the docs migration.

Thanks for opening it @Supplementing!

@Supplementing
Copy link
Contributor Author

@elasticmachine merge upstream

@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
aiAssistantManagementSelection 92.5KB 92.6KB +65.0B
fleet 1.7MB 1.7MB +797.0B
lists 136.5KB 136.6KB +65.0B
total +927.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
core 474.6KB 474.7KB +65.0B

History

Copy link
Contributor

@kilfoyle kilfoyle left a comment

Choose a reason for hiding this comment

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

LGTM! 🚢

Just one super small suggestion for the error text.

@Supplementing Supplementing merged commit 5903c7a into elastic:main Mar 4, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team v9.1.0
Projects
None yet
5 participants