[Infra] Fix asset details locator params in custom dashboards#256412
Merged
rmyz merged 1 commit intoelastic:mainfrom Mar 6, 2026
Merged
[Infra] Fix asset details locator params in custom dashboards#256412rmyz merged 1 commit intoelastic:mainfrom
rmyz merged 1 commit intoelastic:mainfrom
Conversation
Contributor
|
Pinging @elastic/obs-presentation-team (Team:obs-presentation) |
crespocarlos
approved these changes
Mar 6, 2026
Contributor
|
Starting backport for target branches: 9.3 |
Contributor
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Async chunks
Page load bundle
cc @rmyz |
Contributor
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
kibanamachine
added a commit
that referenced
this pull request
Mar 6, 2026
…256412) (#256442) # Backport This will backport the following commits from `main` to `9.3`: - [[Infra] Fix asset details locator params in custom dashboards (#256412)](#256412) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Sergi Romeu","email":"sergi.romeu@elastic.co"},"sourceCommit":{"committedDate":"2026-03-06T11:56:11Z","message":"[Infra] Fix asset details locator params in custom dashboards (#256412)","sha":"c0ebf8b52a3d49dcec44bf491d12144d9a87f50f","branchLabelMapping":{"^v9.4.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","backport:version","v9.4.0","Team:obs-presentation","v9.3.2"],"title":"[Infra] Fix asset details locator params in custom dashboards","number":256412,"url":"https://github.com/elastic/kibana/pull/256412","mergeCommit":{"message":"[Infra] Fix asset details locator params in custom dashboards (#256412)","sha":"c0ebf8b52a3d49dcec44bf491d12144d9a87f50f"}},"sourceBranch":"main","suggestedTargetBranches":["9.3"],"targetPullRequestStates":[{"branch":"main","label":"v9.4.0","branchLabelMappingKey":"^v9.4.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/256412","number":256412,"mergeCommit":{"message":"[Infra] Fix asset details locator params in custom dashboards (#256412)","sha":"c0ebf8b52a3d49dcec44bf491d12144d9a87f50f"}},{"branch":"9.3","label":"v9.3.2","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Sergi Romeu <sergi.romeu@elastic.co>
kapral18
pushed a commit
to kapral18/kibana
that referenced
this pull request
Mar 9, 2026
qn895
pushed a commit
to qn895/kibana
that referenced
this pull request
Mar 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #256161.
Fixes a crash (
"The inventory model you've attempted to find does not exist") that occurred when navigating from the Dashboards tab in the Infrastructure asset detail page.Root cause
The
getLocatorParamsfunction in the Dashboards tab component (dashboards.tsx) was passingassetTypeandassetIdto theASSET_DETAILS_LOCATOR, but the locator expectsentityTypeandentityId. Because the expected properties were missing from the params, both resolved toundefined, producing a broken URL:When this URL was matched by the router,
findInventoryModel("undefined")threw because"undefined"is not a valid inventory type (host,pod,container,awsEC2, etc.).Changes
infra/.../dashboards/dashboards.tsxassetType→entityType,assetId→entityIdobservability_shared/.../asset_details_locator.ts/inventorywhenentityTypeorentityIdis falsy/detail/undefined/...URLs, even if a caller passes missing params in the futureHow to reproduce (before fix)
observability:enableInfrastructureAssetCustomDashboardsadvanced setting enabled)x-pack/solutions/observability/plugins/infra/public/components/asset_details/tabs/dashboards/dashboards.tsx->console.log('locator', locator.getRedirectUrl({ dashboardId: '123' }));in L196You can copy the URL from the console.log and navigate to a new tab, and you should see "detail/undefined/undefined..." (make sure you are not checked out to this branch)
How to verify (after fix)