Skip to content
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(diagnostic): implement diagnostics class with gc invocation operation #644

Merged
merged 4 commits into from
Oct 1, 2024

Conversation

andrewazores
Copy link
Member

@andrewazores andrewazores commented Sep 10, 2024

Welcome to Cryostat! 👋

Before contributing, make sure you have:

  • Read the contributing guidelines
  • Linked a relevant issue which this PR resolves
  • Linked any other relevant issues, PR's, or documentation, if any
  • Resolved all conflicts, if any
  • Rebased your branch PR on top of the latest upstream main branch
  • Attached at least one of the following labels to the PR: [chore, ci, docs, feat, fix, test]
  • Signed all commits using a GPG signature

To recreate commits with GPG signature git fetch upstream && git rebase --force --gpg-sign upstream/main


Related to #133
Depends on cryostatio/cryostat-core#459
NOTE Since this depends on an addition to -core, which publishes snapshot builds but for which the CI to do so is currently broken, this cannot be merged until that CI failure is resolved. Otherwise, Cryostat (and the associated upcoming Agent PR) will fail to build and all CI will be failing.

Description of the change:

Implements the Agent HTTP delegation side of the MBean operation invocation request, and adds a beta API endpoint which invokes the GC operation on the Agent HTTP or JMX connection to the specified Target JVM.

Motivation for the change:

Combined with the -core change and upcoming -agent and -web changes, this will allow the user to click a button in the Cryostat UI to send a request to their Target JVM requesting that it perform a garbage collection.

How to manually test:

  1. Run CRYOSTAT_IMAGE=quay.io... bash smoketest.bash...
  2. ...

@andrewazores andrewazores added feat New feature or request safe-to-test labels Sep 10, 2024
Copy link

@andrewazores andrewazores marked this pull request as ready for review October 1, 2024 19:30
@andrewazores
Copy link
Member Author

/build_test

Copy link

github-actions bot commented Oct 1, 2024

Workflow started at 10/1/2024, 3:44:56 PM. View Actions Run.

Copy link

github-actions bot commented Oct 1, 2024

No GraphQL schema changes detected.

Copy link

github-actions bot commented Oct 1, 2024

OpenAPI schema change detected:

diff --git a/schema/openapi.yaml b/schema/openapi.yaml
index ca6280b..7ccd335 100644
--- a/schema/openapi.yaml
+++ b/schema/openapi.yaml
@@ -649,20 +649,40 @@ info:
     name: Cryostat Community
     url: https://cryostat.io
   description: Cloud-Native JDK Flight Recorder
   license:
     name: Apache 2.0
     url: https://github.com/cryostatio/cryostat/blob/main/LICENSE
   title: Cryostat API
   version: 4.0.0-snapshot
 openapi: 3.0.3
 paths:
+  /api/beta/diagnostics/targets/{targetId}/gc:
+    post:
+      parameters:
+        - in: path
+          name: targetId
+          required: true
+          schema:
+            format: int64
+            type: integer
+      responses:
+        "201":
+          description: Created
+        "401":
+          description: Not Authorized
+        "403":
+          description: Not Allowed
+      security:
+        - SecurityScheme: []
+      tags:
+        - Diagnostics
   /api/beta/fs/recordings:
     get:
       responses:
         "200":
           content:
             application/json:
               schema:
                 items:
                   $ref: '#/components/schemas/ArchivedRecordingDirectory'
                 type: array

Copy link

github-actions bot commented Oct 1, 2024

Schema changes committed by the CI.

Copy link

github-actions bot commented Oct 1, 2024

CI build and push: All tests pass ✅
https://github.com/cryostatio/cryostat/actions/runs/11132348804

@andrewazores andrewazores merged commit 231da62 into cryostatio:main Oct 1, 2024
4 checks passed
@andrewazores andrewazores deleted the mxbean-invoke branch October 1, 2024 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat New feature or request safe-to-test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant