Visualize OSGi Service Graphs with Composum
Published on by Dan Klco
Here's a neat trick for AEM developers and architects: you can create an diagram representation of the service dependencies using Composum. For those not familiar, Composum is an Open-Source project based on Apache Sling.
Once you install the dependencies you can access the Composum Service Graph web console at /system/console/servicegraph.
Using the Service Graph Web Console
The Service Graph Web Console has a couple fields, the most important being the Classnames Regex. You can put any regular expression to filter what classes should be including:
- ^com.composum
- ^com.day.cq.wcm.foundation.forms
Downloading as an Image
Currently, the Service Graph is only available as a SVG, not a downloadable image, but using the following JavaScript snippet you can download the Service Graph:
I've also created an issue with the Composum team to include this in their next release.