cryostat-operator icon indicating copy to clipboard operation
cryostat-operator copied to clipboard

Preload OpenShift-specific useful Automated Rules definitions

Open andrewazores opened this issue 2 years ago • 0 comments

Since https://github.com/cryostatio/cryostat/pull/1084 , Cryostat allows clients to define Automated Rules with an enabled: boolean property. Rules can be created with enabled: false, or they can be updated at any later point in time to enable/disable as well. When a rule is disabled its definition is stored and it is available for later enabling/activation, but it does not actually do anything until enabled. Once enabled the rule is applied against all matching target JVMs and continues to match against newly discovered JVMs, the usual way that Automated Rules work.

It would be very nice if we could set up Cryostat instances managed by the Operator with some Automated Rules definitions out of the box that are disabled, but available for the user to simply turn on as they desire. These rules would be useful for the user directly as well as useful as templates for the user to download, edit, and re-upload to tailor to their specific needs. Here's an example rule definition:

{
  "name": "openshift_monitoring",
  "description": "Enable this rule to activate a continuous monitoring JFR recording to all JVMs in the namespace with the OpenShift annotation \"cryostat.io/monitoring: true\". Data will be archived every 30 seconds and 10 minutes of data will be retained in archives.",
  "matchExpression": "target.annotations.platform[\"cryostat.io/monitoring\"] == 'true'",
  "eventSpecifier": "template=Continuous,type=TARGET",
  "archivalPeriodSeconds": 30,
  "initialDelaySeconds": 30,
  "preservedArchives": 20,
  "maxAgeSeconds": 32,
  "maxSizeBytes": 0,
  "enabled": false
}

andrewazores avatar Oct 03 '22 21:10 andrewazores