Skip to content

feat(triggers): Add Mbean selector to Trigger Creation Form#2192

Open
Josh-Matsuoka wants to merge 12 commits intocryostatio:mainfrom
Josh-Matsuoka:mbean-selector-2
Open

feat(triggers): Add Mbean selector to Trigger Creation Form#2192
Josh-Matsuoka wants to merge 12 commits intocryostatio:mainfrom
Josh-Matsuoka:mbean-selector-2

Conversation

@Josh-Matsuoka
Copy link
Copy Markdown
Contributor

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


Fixes: #

Depends on: #2155 cryostatio/cryostat-core#667 cryostatio/cryostat-agent#849 cryostatio/cryostat#1467

Description of the change:

  • Adds an Mbean selector component to the Trigger Creation Form displaying all currently available Mbean attributes.
  • Currently filters them to only the ones available through mbeanMetrics since internally that's currently what Smart Triggers are evaluated against. In future if/once they're extended to check against generic mbean attributes we can unfilter them.

How to manually test:

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

@Josh-Matsuoka Josh-Matsuoka added feat New feature or request safe-to-test labels Apr 15, 2026
isIs: boolean;
}

export interface MbeanAttributeMap {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: MBean, capital B

onAccept: (s: string) => void;
}

export interface MbeanSelectorOption {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

Copy link
Copy Markdown
Member

@andrewazores andrewazores left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a little confused about the MBean query list and filtering for the supported attributes.

'SystemLoadAverage',
'ProcessCpuLoad',
'TotalPhysicalMemorySize',
'FreePhyiscalMemorySize',
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo? Phyiscal -> Physical

const MbeanOptions = React.useMemo(() => {
var attributes: MbeanSelectorOption[] = [];
mbeans.forEach((m: MbeanAttributeMap) => {
m.attributes.forEach((i: MBeanAttributeInfo) => {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If supportedTriggerAttributes is just a hardcoded list of the MBeans we expect to see present in the remote JVM, then do we even need to send a query at this point... ? It seems like just returning the supported attributes list would do the same thing more simply, until we actually have some wider support on the backend (agent side) for processing other MBean metrics in the CEL expressions. Or am I missing something here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're correct that hardcoding it would achieve the same thing, I wanted to lay the groundwork here for generic mbean attributes down the line but for now we can get rid of the query if you'd prefer and just hardcode the list options.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's currently functionally equivalent then I think for now let's just go with the hardcoded list so that we can get that UI enhancement in, and work on the broader-scoped change that affects multiple components when we're further out from a dev freeze. Maybe the hardcoded version of this can go directly into #2155 and this PR can build on top of that do to the enhanced filtering based on actual live data pulled from the Agent.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good, I'll add it to that PR

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] SmartTriggers creation form

2 participants