-
Notifications
You must be signed in to change notification settings - Fork 31
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
feat(agent): implement HTTP JFR snapshot creation #1627
feat(agent): implement HTTP JFR snapshot creation #1627
Conversation
On this, what differentiates the endpoint between a recording and a snapshot recording? or the logic will be taken care of on the agent side depending on the template created? i.e custom or if a recordings exist to successfully create a snapshot? on the method |
Test image available:
|
Test image available:
|
This needs to be coordinated with Ming's PR on the Agent (in this case acting as the server): cryostatio/cryostat-agent#186 |
I did.. Just confirming coz the endpoint is the same and the logic is taken care of in the |
The endpoint is the same, but the Agent-side change does expect some particular request format in the payload to indicate that the request is for a snapshot: |
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.
Looking good. I think the only remaining thing to do is a one-liner change in AgentJFRService
to call this method at the appropriate place (getSnapshotRecording()
I think).
I'm getting a 500 Internal Server Error too |
IIRC what I saw in the web-client was a Cryostat should probably have responded to the web-client with a |
I think I know what the problem is- the IsValid() logic is incorrect on the agent side |
That's what I thought, too. |
Looks like there's a new/different error when I check now vs when I checked last. It looks like the snapshot request actually does go through successfully (also supported by examining the logs on both components): But the Cryostat server also tries to invoke |
Basically, after creating the remote snapshot, the server also wants to be able to rename the recording. Since we have more control over this process when doing it over HTTP it might make sense to simply provide that name on the original request, rather than perform the request to create the snapshot and immediately try to rename it, but that would require some deeper refactoring and changing of logic since the JMX side does not support that flow. For simplicity I think we can just proceed with maintaining that same logic even over HTTP: create the snapshot first, then follow-up with a request to rename it. The I would suggest these might be done by the Cryostat server sending a |
f129c39
to
0709324
Compare
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.
Pull Request blocked. web-client
submodule updates are performed automatically by CI when that repository is updated. Please revert or drop all changes to the web-client
submodule from this PR and perform any required frontend work by opening and merging a PR against cryostat-web.
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.
Pull Request blocked. web-client
submodule updates are performed automatically by CI when that repository is updated. Please revert or drop all changes to the web-client
submodule from this PR and perform any required frontend work by opening and merging a PR against cryostat-web.
0709324
to
02b4dbb
Compare
02b4dbb
to
783b5cf
Compare
If you check the Cryostat server logs, you should be able to find the stack trace of that NullPointerException and this will show you the exact line of code where it is occurring, so you will be able to tell which Observing |
942c548
to
151ba16
Compare
@aali309 @mwangggg I haven't looked into which side is causing this, but it looks to me like the rename attempt is failing because there are quotation marks surrounding the new name. So from the evidence in these screenshots it seems:
This check is almost the last thing the server does before sending an OK response to the original client: https://github.com/cryostatio/cryostat/blob/198c811d777eae7472ccb124349049c39068c947/src/main/java/io/cryostat/net/web/http/api/v1/TargetSnapshotPostHandler.java#L92 After that succeeds the server will try to open the remote snapshot stream to verify that the snapshot actually has contents, which uses the same remote streaming API that we have for downloading recordings and which already works. If the verification fails then the server will ask the agent to delete the recording, which also should already work. So I think this rename operation bug is the last hurdle to getting this feature across the finish line. |
This reverts commit 89f096b.
c3559a9
into
cryostatio:1578-epic-two-way-agent-communications
Co-authored-by: Andrew Azores <[email protected]>
Co-authored-by: Andrew Azores <[email protected]>
Co-authored-by: Andrew Azores <[email protected]>
Co-authored-by: Andrew Azores <[email protected]>
Co-authored-by: Andrew Azores <[email protected]>
* feat(agent): implement Agent HTTP dynamic JFR start (#1566) * chore(svc): extract EventOptionsBuilder to -core and use new CryostatFlightRecorderService * test(smoketest): enable API writes on one agent-equipped sample app * chore(serial): extract recording descriptor to -core * chore(activerecordings): clean up an error handler * feat(agent): implement dynamic start of JFR over HTTP * bump -core version * feat(agent): implement Agent HTTP dynamic JFR stop/delete (#1604) * feat(agent): implement Agent HTTP recording retrieval (#1607) * feat(agent): implement HTTP JFR snapshot creation (#1627) Co-authored-by: Atif Ali <[email protected]>
Welcome to Cryostat! 👋
Before contributing, make sure you have:
main
branch[chore, ci, docs, feat, fix, test]
To recreate commits with GPG signature
git fetch upstream && git rebase --force --gpg-sign upstream/main
Fixes: #1613
Description of the change:
This change allows users to start snapshot via HTTP
Motivation for the change:
This continues the effort to bring Cryostat application feature parity between JMX and HTTP connection methods.
How to manually test: