feat(diagnostics): Add frontend for thread dumps#1647
feat(diagnostics): Add frontend for thread dumps#1647andrewazores merged 22 commits intocryostatio:mainfrom
Conversation
|
Review notes from recent call:
|
|
Also, some tests would be nice - at least some snapshot tests to make sure the table renders as expected when the mock |
|
Still failing |
andrewazores
left a comment
There was a problem hiding this comment.
I think we also need something equivalent to the "All Targets Archives" view. As it stands, this UI design only allows the user to view/download/delete thread dumps which belong to a currently discovered target. If that target disappears then there is no more way via the UI to ever see those thread dumps to download or delete them.
|
CI doesn't seem to like toBeCalledWith, it's passing locally for me and the usage is consistent with other uses of it elsewhere so I'm not entirely sure what's wrong |
Could you reorganize the kebab menu for the Thread Dump items? I think the established pattern of "<other actions>, separator, delete" has been working well. Also, when downloading a thread dump file, it currently just gets saved with the (UU)ID as the filename. I see that you have some logic in |
The content-disposition header is already set in the backend, it follows the same structure as the archived recordings download. Looking into this further the filename is set correctly in the frontend, anchor.download gets set to it, however looking at the request that gets sent to the download endpoint and it's headers, the filename doesn't seem to be specified anywhere. The query parameter that would set the filename is thus null when it makes it to the backend: cryostat-1 | 2025-08-01 17:12:59,901 WARN [io.cry.dia.Diagnostics] (executor-thread-8) Handling download Request for key: (IX6TpNMZWQSweVAWEtKTrm_j0OtjGZhC_EoJv-d-o6Y=,5e42ed2f-7ca3-4f33-b3ee-60348ef45060) So it defaults to using the thread dump id as the filename. |
|
@andrewazores any idea what's causing the above? ^ |
https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/a#download
The backend sets the Content-Disposition header based on the S3 filename that it knows about, which is just the UUID. The browser uses this to set the downloaded filename. I guess that the frontend |
|
Download filename is now set with cryostatio/cryostat@19b5025 |
|
If I open my browser's devtools and watch the network traffic when clicking on the Dashboard card item to trigger a thread dump, I see 1 request to perform the dump and then 3 identical requests in rapid succession to query available dumps ( Also, if I click the "Invoke Garbage Collection" button on the card instead, then there are also two identical threaddump I suspect something is not quite right with some React hooks on the Diagnostics dashboard card, causing it to re-render and re-query state too often. |




Related to cryostatio/cryostat#135
Adds an initial frontend for triggering and displaying thread dumps in cryostat. This is done via a new button on the Diagnostics card which changes to a redirect to the diagnostics page once complete, as well as a new diagnostics page with a table for displaying and downloading captured thread dumps.
To test,
-- TAGS=latest ARCHS=amd64 CRYOSTAT_AGENT_VERSION=0.6.0-SNAPSHOT ./build.bash
-- Click the thread dump button ("Trigger thread dump"), verify that the thread dumps api is called and a notification is received indicating the thread dump completed
-- Verify that the button changes to redirect you to the diagnostics page
-- Verify that the last modifed time is correct and that the thread dump can be downloaded/deleted
-- Click the upload button at the top of the table, verify that it triggers a thread dump and it appears in the table
-- Verify that triggering new thread dumps or deleting them from the table refreshes it.