[MAGNOLIA-9181] Expose EventListenerMBean for monitoring Created: 10/Nov/23  Updated: 01/Feb/24  Resolved: 22/Jan/24

Status: Closed
Project: Magnolia
Component/s: core
Affects Version/s: None
Fix Version/s: 6.3.0

Type: Story Priority: Neutral
Reporter: Michael Duerig Assignee: Michael Duerig
Resolution: Done Votes: 0
Labels: dx-core-6.3
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File Screenshot 2024-01-22 at 13.27.42.png    
Issue Links:
Cloners
is cloned by MAGNOLIA-9183 Expose QueryStatManagerMBean for moni... Closed
dependency
depends upon MAGNOLIA-9198 Refactor ProviderImpl to gain access ... Closed
depends upon MAGNOLIA-9230 Remove deprecated utility class Obser... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[X]* Doc/release notes changes? Comment present?
[X]* Downstream builds green?
[X]* Solution information and context easily available?
[X]* Tests
[X]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Release notes required:
Yes
Documentation update required:
Yes
Date of First Response:
Epic Link: Collect Usage Metrics
Work Started:
Approved:
Yes

 Description   

Jackrabbit provides the org.apache.jackrabbit.api.jmx.EventListenerMBean per observation listener with statistics about observation events. We should register them either with the MBean server info.magnolia.cms.util.MBeanUtil#registerMBean or Dropwizard metrics (info.magnolia.monitoring.MicrometerRegistryProvider).

Discovery

  • The EventListenerMBean is available from the info.magnolia.observation.WorkspaceEventListenerRegistration.TrackedEventListener, which is a wrapper for EventHandler tracking and exposing observation relevant statistics.
  • We can wrap EventHandlers when they are being registered at info.magnolia.observation.WorkspaceEventListenerRegistration.Registrar#register.
  • We could also wrap them when registering them via info.magnolia.cms.util.ObservationUtil#registerChangeListener and its overloads. However unregistered them is tricker we would need to keep a map from tracked to untracked handlers. A better option might be to remove these methods, which are deprecates since 2016.
  • There seems to be no easy way to register the MBeans for observation listeners registered via ObservationUtil (which is deprecated since 5.4.). Best course of action would be to remove that class and replace remaining usages (which could also be in our modules). Alternatively we could just ignore the listeners registered through it and not expose the MBean for those.


 Comments   
Comment by Michael Duerig [ 22/Jan/24 ]

For documentation:

The EventListenerMBean MBean exposes the following metrics about the JCR observation. Observation listeners on the config workspace do not expose this MBean (see MAGNOLIA-9258). See Javadoc of org.apache.jackrabbit.api.jmx.EventListenerMBean for details.

/cc amansell

Comment by Michael Duerig [ 22/Jan/24 ]

amansell this is just a pointer to the Javadoc. I'd keep the documentation general, mentioning that MBean, what purpose it serves and link to the Javadoc for the details.

Generated at Mon Feb 12 04:39:19 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.