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(rules): implement declarative Automated Rules #749

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

andrewazores
Copy link
Member

@andrewazores andrewazores commented Dec 19, 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


Based on #735
Depends on #735
Fixes #548
Fixes #727

Description of the change:

Adds a declarative configuration directory for Automated Rules and implements loading definitions from this directory at startup.

Motivation for the change:

This will allow users to preload Automated Rules into their Cryostat installations without needing to go through the web UI or API calls. It also allows us to ship pre-written Rule definitions as part of the base container image.

For practical usage, end users who are using JMX for target connections should have JMX authentication configured. In that case, #720 would also need to be complete for the user to make full use of declarative Automated Rules. Otherwise, users can declaratively configure their own Automated Rules, but will still need to go through the UI or API to define the corresponding stored credentials. For users who are using the Cryostat Agent this will already work out of the box, since the Agent registers its own stored credentials.

Since this also provides preset Automated Rules as part of the container image, it's also useful as a way for us to ship example rule configurations for users to reference when crafting their own.

How to manually test:

  1. Check out and build PR
  2. ./smoketest.bash -O
  3. Open Web UI
  4. Go to Automated Rules view. There should already be a quarkus Rule predefined as part of this PR.
  5. Cryostat itself is a compatible Target for the quarkus Rule. Enable the Rule and an auto_quarkus recording should be started on Cryostat. See feat(matchexpressions): expressions can reference target JFR event type IDs #735 and feat(eventtemplates): add Preset event templates type and Quarkus-specific preset #733

@andrewazores andrewazores added feat New feature or request safe-to-test and removed dependent labels Dec 19, 2024
@andrewazores andrewazores force-pushed the declarative-rules branch 2 times, most recently from 637623c to 306d541 Compare December 19, 2024 21:45
Copy link

This PR/issue depends on:

@andrewazores andrewazores marked this pull request as ready for review December 20, 2024 00:18
@andrewazores andrewazores requested a review from a team as a code owner December 20, 2024 00:18
@andrewazores andrewazores requested a review from a team December 20, 2024 00:18
@andrewazores
Copy link
Member Author

/build_test

Copy link

Workflow started at 12/19/2024, 7:22:14 PM. View Actions Run.

Copy link

No GraphQL schema changes detected.

Copy link

No OpenAPI schema changes detected.

Copy link

CI build and push: At least one test failed ❌
https://github.com/cryostatio/cryostat/actions/runs/12423063295

@andrewazores
Copy link
Member Author

/build_test

Copy link

Workflow started at 12/19/2024, 9:52:21 PM. View Actions Run.

Copy link

No GraphQL schema changes detected.

Copy link

No OpenAPI schema changes detected.

Copy link

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

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.

[Task] Declarative Automated Rules [Request] Support Quarkus JFR events
1 participant