feat(diagnostics): Add thread dump capturing to diagnostics endpoint#639
feat(diagnostics): Add thread dump capturing to diagnostics endpoint#639andrewazores merged 3 commits intocryostatio:mainfrom
Conversation
|
Dumps via JMX look like this: but dumps via Agent HTTP look like this:
as a single line, so I suspect that the |
|
@Josh-Matsuoka ping - any idea on the issue above? |
|
This is indeed casued by the ObjectMapper, it serializes the thread dump string into Json which escapes the newlines and other special characters creating that output. We could go back to the old method of using a separate branch and not using the ObjectMapper but the cleanest solution I think is to add handling in the server to handle the response and deserialize it back. I've updated the server side here to fix it: |
|
Nice, that works. |
|
I'm not sure if this is a problem on the server side, or if it's because of the data the Agent is sending back, but now when I try to request a thread dump on an |
|
This was caused by the rebase of the server side, it changed the type of Response that gets returned to invokeMbean, there was an extra step needed to get the json body. Fixed now. |
3a364d6 to
e6d01ae
Compare
Related to cryostatio/cryostat#135
Adds the ability to capture thread dumps to the agent's mbean-invoke endpoint. The original implementation of the endpoint is already fairly flexible, essentially acting as a wrapper around the mbean.invoke method, so we just need to extend the check for valid/supported operations, and add a further check if we're doing a thread dump so it can be written to the response body as-is.
Currently supports the threadPrint operation but leaves an opening for the threadDumpToFile operation to be supported later if necessary. Note that the format of threadDumpToFile isn't supported by existing support tooling so it won't work for the purposes of the linked issue, only threadPrint.
Opening as Draft until the other pieces of the feature are in place.