-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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] fix index template from datastream name #166941
Conversation
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
esClient: ElasticsearchClient, | ||
dataStreamName: string | ||
): Promise<string> { | ||
const dataStream = await esClient.indices.getDataStream({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just double checking, does this getDataStream call work even if the stream has no data?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good question, I'll check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
checked and if the data stream doesn't exist, it is not hitting this code path
Pinging @elastic/fleet (Team:Fleet) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't believe we didn't always do it this way, makes me scared there is some niche reason that we did :D
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]
History
To update your PR or re-run it, just comment with: |
## Summary Resolve elastic#164269 Some context why I picked this up now: elastic#162772 (comment) To verify: - Make sure 8.8+ apm package is installed - Create data stream `PUT _data_stream/metrics-apm.app.default-default` - Reinstall apm package from API or UI - Check kibana info logs, expect to not see simulate template error and rollover like below ``` [2023-09-21T15:54:36.559+02:00][INFO ][plugins.fleet] Mappings update for metrics-apm.app.default-default failed due to ResponseError: illegal_argument_exception Root causes: illegal_argument_exception: unable to simulate template [metrics-apm.app.default] that does not exist [2023-09-21T15:54:36.559+02:00][INFO ][plugins.fleet] Triggering a rollover for metrics-apm.app.default-default ``` ### Checklist - [x] [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 (cherry picked from commit 3ff82f2)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…7008) # Backport This will backport the following commits from `main` to `8.10`: - [[Fleet] fix index template from datastream name (#166941)](#166941) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Julia Bardi","email":"90178898+juliaElastic@users.noreply.github.com"},"sourceCommit":{"committedDate":"2023-09-22T08:20:05Z","message":"[Fleet] fix index template from datastream name (#166941)\n\n## Summary\r\n\r\nResolve https://github.com/elastic/kibana/issues/164269\r\n\r\nSome context why I picked this up now:\r\nhttps://github.com//issues/162772#issuecomment-1728031080\r\n\r\nTo verify:\r\n- Make sure 8.8+ apm package is installed\r\n- Create data stream `PUT _data_stream/metrics-apm.app.default-default`\r\n- Reinstall apm package from API or UI\r\n- Check kibana info logs, expect to not see simulate template error and\r\nrollover like below\r\n\r\n```\r\n[2023-09-21T15:54:36.559+02:00][INFO ][plugins.fleet] Mappings update for metrics-apm.app.default-default failed due to ResponseError: illegal_argument_exception\r\n Root causes:\r\n illegal_argument_exception: unable to simulate template [metrics-apm.app.default] that does not exist\r\n[2023-09-21T15:54:36.559+02:00][INFO ][plugins.fleet] Triggering a rollover for metrics-apm.app.default-default\r\n```\r\n\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios","sha":"3ff82f2c17e532fed5d5544ed9bbae4f6e7331af","branchLabelMapping":{"^v8.11.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Fleet","backport:prev-minor","v8.11.0"],"number":166941,"url":"https://github.com/elastic/kibana/pull/166941","mergeCommit":{"message":"[Fleet] fix index template from datastream name (#166941)\n\n## Summary\r\n\r\nResolve https://github.com/elastic/kibana/issues/164269\r\n\r\nSome context why I picked this up now:\r\nhttps://github.com//issues/162772#issuecomment-1728031080\r\n\r\nTo verify:\r\n- Make sure 8.8+ apm package is installed\r\n- Create data stream `PUT _data_stream/metrics-apm.app.default-default`\r\n- Reinstall apm package from API or UI\r\n- Check kibana info logs, expect to not see simulate template error and\r\nrollover like below\r\n\r\n```\r\n[2023-09-21T15:54:36.559+02:00][INFO ][plugins.fleet] Mappings update for metrics-apm.app.default-default failed due to ResponseError: illegal_argument_exception\r\n Root causes:\r\n illegal_argument_exception: unable to simulate template [metrics-apm.app.default] that does not exist\r\n[2023-09-21T15:54:36.559+02:00][INFO ][plugins.fleet] Triggering a rollover for metrics-apm.app.default-default\r\n```\r\n\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios","sha":"3ff82f2c17e532fed5d5544ed9bbae4f6e7331af"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.11.0","labelRegex":"^v8.11.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/166941","number":166941,"mergeCommit":{"message":"[Fleet] fix index template from datastream name (#166941)\n\n## Summary\r\n\r\nResolve https://github.com/elastic/kibana/issues/164269\r\n\r\nSome context why I picked this up now:\r\nhttps://github.com//issues/162772#issuecomment-1728031080\r\n\r\nTo verify:\r\n- Make sure 8.8+ apm package is installed\r\n- Create data stream `PUT _data_stream/metrics-apm.app.default-default`\r\n- Reinstall apm package from API or UI\r\n- Check kibana info logs, expect to not see simulate template error and\r\nrollover like below\r\n\r\n```\r\n[2023-09-21T15:54:36.559+02:00][INFO ][plugins.fleet] Mappings update for metrics-apm.app.default-default failed due to ResponseError: illegal_argument_exception\r\n Root causes:\r\n illegal_argument_exception: unable to simulate template [metrics-apm.app.default] that does not exist\r\n[2023-09-21T15:54:36.559+02:00][INFO ][plugins.fleet] Triggering a rollover for metrics-apm.app.default-default\r\n```\r\n\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios","sha":"3ff82f2c17e532fed5d5544ed9bbae4f6e7331af"}}]}] BACKPORT--> Co-authored-by: Julia Bardi <90178898+juliaElastic@users.noreply.github.com>
Summary
Resolve #164269
Some context why I picked this up now: #162772 (comment)
To verify:
PUT _data_stream/metrics-apm.app.default-default
Checklist