Skip to content

app/vmui: keep the selected tenant when opening a trace - #303

Merged
arturminchukov merged 5 commits into
VictoriaMetrics:masterfrom
mastersans:issue-293
Nov 9, 2026
Merged

arturminchukov merged 5 commits into
VictoriaMetrics:masterfrom
mastersans:issue-293

Conversation

@mastersans

Copy link
Copy Markdown
Contributor

fixes: #293

Summary:

  • Opening a trace from vmui dropped accountID and projectID, so the trace page queried tenant 0:0 and showed no data.
  • "View full trace", the trace-table action, and linked traces now keep the tenant from the current URL.

Signed-off-by: Sanskar Sharma <sanskarsharma3110@gmail.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 7 files

Click Fix with cubic on a comment, or reply @cubic-dev-ai fix this, and cubic writes the fix.

Re-trigger cubic

Signed-off-by: Sanskar Sharma <sanskarsharma3110@gmail.com>

@arturminchukov arturminchukov left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks a lot for the PR! Overall, it looks good! I've left a few comments and want to ask you to also fix one more problem related to tenant params:

The header logo click also drops the selected tenant (same class of bug as #293). Could you please fix it as well?

Root cause, layouts/Header/Header.tsx:

  • onClickLogo navigates to { pathname: router.home } without search and then reloads, so the explorer opens with tenant 0:0.
  • Logo renders <NavLink to={router.home}>, so Ctrl/Cmd-click (new tab) uses an href without the tenant as well.

Suggested fix (same pattern as HeaderNav/NavItem.tsx):

  1. In Header, get searchParams via useSearchParams and build tenantSearch = getTenantSearchParams(searchParams).
  2. Build homeLocation = { pathname: router.home, search: tenantSearch.toString() } once.
  3. Pass homeLocation to the logo's NavLink via to (make Logo accept it as a prop), so the href keeps the tenant.
  4. In onClickLogo, call navigate(homeLocation) instead of navigate({ pathname: router.home }). Keep window.location.reload() as is.

No new helpers needed; getTenantSearchParams already lives in hooks/useTenant.ts.

@mastersans

Copy link
Copy Markdown
Contributor Author

Sure @arturminchukov Will fix it aswell !

Signed-off-by: Sanskar Sharma <sanskarsharma3110@gmail.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 13 files (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

@mastersans

Copy link
Copy Markdown
Contributor Author

Hi @arturminchukov I have resolve all the comments and also fixed the Header Logo bug with this. PTAL!

Screen.Recording.2026-11-09.at.1.53.10.PM.mp4

@arturminchukov arturminchukov left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM! @mastersans, thanks for the contribution! I just deleted the unnecessary handler onClick in the Header.

@arturminchukov
arturminchukov merged commit 761466e into VictoriaMetrics:master Nov 9, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

vmui: "View full trace" drops accountID/projectID, trace not shown for non-default tenant

2 participants