Skip to content

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 PR 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
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Mar 22, 2025
Closes elastic#206194 


## Summary

- 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
### 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](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
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](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] 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](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) 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](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

### Identify risks

n/a

---------

Co-authored-by: Elastic Machine <[email protected]>
kpollich added a commit that referenced this pull request Apr 28, 2025
kpollich added a commit that referenced this pull request Apr 28, 2025
Reverts #212422

We don't want to surface this Beats-specific syntax for dynamic topics
because it greatly harms our ability to migrate users to OTel.

The recommended way to handle complex multi-field interpolations for
topic names is to use an `add_field` Beats processor to add the desired
topic name as a distinct field, and then use that field for the dynamic
topic name in the Fleet-managed Kafka output. I'll be filing a docs
issue to get this in our public docs as well.
akowalska622 pushed a commit to akowalska622/kibana that referenced this pull request May 29, 2025
…#219415)

Reverts elastic#212422

We don't want to surface this Beats-specific syntax for dynamic topics
because it greatly harms our ability to migrate users to OTel.

The recommended way to handle complex multi-field interpolations for
topic names is to use an `add_field` Beats processor to add the desired
topic name as a distinct field, and then use that field for the dynamic
topic name in the Fleet-managed Kafka output. I'll be filing a docs
issue to get this in our public docs as well.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This PR 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
Development

Successfully merging this pull request may close these issues.

Fleet : Kafka output : Dynamic Topic : Kibana wraps the custom topic name with a leading '%{[' and trailing ']}' pattern
5 participants