Back To Blog

Alfred Telemetry: metrics for Alfresco Digital Platform

Monitoring is the key to a healthy Alfresco Platform installation. Metrics give insight into how the application is behaving and make it possible to react quickly when something is not right. At this moment an enormous amount of monitoring systems are available, each one with its own concepts and usage. Furthermore, there is not one of these monitoring systems which is the best, they all have their perks and cons.

As a result, different companies way too often need to start building their Alfresco monitoring stack from scratch, simply because there is no integration available for their preferred monitoring system.

Another challenge that comes with monitoring, is the recording of custom metrics. General metrics (e.g. JVM, System, …) give a good insight into the Alfresco environment, but often specific, custom metrics need to be monitored to get insight into e.g. Alfresco extensions. 

The monitoring ecosystem

Luckily Alfresco is not the only application platform facing these challenges, and the open-source world provides solutions. Alfred Telemetry is built upon one of these open source solutions and integrates it with Alfresco:  Micrometer.io

Let’s take a moment to gain an understanding of and start appreciating Micrometer:

  • Micrometer provides a simple facade over the instrumentation clients for the most popular monitoring systems, allowing you to instrument your JVM-based application code without vendor lock-in. Think SLF4J, but for application metrics! Application metrics recorded by Micrometer are intended to be used to observe, alert, and react to the current/recent operational state of your environment (Source: https://micrometer.io/docs/).
  • Micrometer is a dimensional-first metrics collection facade whose aim is to allow you to time, count, and gauge your code with a vendor-neutral API (Source: https://spring.io/blog/2018/03/16/micrometer-spring-boot-2-s-new-application-metrics-collector)

“Without vendor lock-in“: Micrometer makes it possible to export your metrics data to one or several monitoring systems through classpath and configuration. System administrators that want to use a different monitoring system don’t have to start building a new monitoring stack from scratch, they just have to configure micrometer to export to that particular system. The metrics instrumentation library provides some out-of-the-box instrumentation that is applicable for any JVM-based application (JVM, caches, file descriptors, …). In other words: by integrating Micrometer in Alfresco, we already have a lot of essential instrumentation and are able to export it to (almost) any monitoring system.

“With a vendor-neutral API”: Micrometer provides an API that can be easily accessed to e.g. record custom metrics. Alfred Telemetry integrates Micrometer with Alfresco, which means this API can be used in any Alfresco Platform extension. As a developer, you record your custom metric by calling the Micrometer API and Micrometer handles the hassle of exporting it to the correct monitoring system.

Alfred telemetry tour

So what exactly is the link between Alfresco, Micrometer, and Alfred Telemetry?

As already mentioned Micrometer is used as a metrics instrumentation library. Nevertheless using this library in Alfresco is not just ‘plug-and-play’.

Just like Spring Boot Actuator makes it possible to easily use Micrometer in Spring Boot, Alfred Telemetry aims to do this for Alfresco.

Let’s get a little bit more specific. A quick peek in the functionalities of Alfred Telemetry:

  • Out-of-the-box compatibility with some monitoring systems

To expose metrics to a monitoring system, the associated `MeterRegistry` needs to be registered in Micrometer. Alfred Telemetry handles this registration, making it possible to export to supported metric systems simply by adding the `MeterRegistry` on the classpath.
At the moment of this writing, Alfred Telemetry supports Graphite, Prometheus, and JMX out of the box but support for other `MeterRegistries` can easily be added.  
It’s worth mentioning once again that there is no commitment to a single monitoring system: customers have the flexibility and can easily switch between one or several monitoring systems.

  • Enabling the out-of-the-box Micrometer metrics

Micrometer offers some default metrics, relevant for any JVM-based application: IO, JVM, Process, … . Alfred Telemetry makes sure those default metrics are available for your Alfresco installation.

  • Inclusion of interesting Alfresco metrics

On top of the metrics provided by Micrometer, Alfred Telemetry introduces the recording of some metrics that are relevant in any Alfresco application, like DB metrics or ticket counter. This list is still rather limited, we’re happy to review pull requests for other useful Alfresco metrics!

  • Make the Micrometer API available in Alfresco extensions

This means the Micrometer – vendor-neutral – API can be used in ANY Alfresco extension: by using the static global registry (`Metrics.globalRegistry`) or by injecting the `meterRegistry` bean in your service:

public class SampleBean {

      private final Counter counter;

      public SampleBean(MeterRegistry registry) {
            this.counter = registry.counter(“received.messages”);
}

public void handleMessage(String message) {
     this.counter.increment();
     // handle message implementation
}

}

This way developers of Alfresco extensions are able to easily record custom business metrics, without any monitoring system vendor lock-in.


Built for developers and admins, Alfred Telemetry provides full visibility and a better understanding of the Alfresco Platform, by recording metrics from Alfresco and Alfresco-related applications and exporting them to the most popular monitoring systems, like Prometheus, Graphite, JMX.

HTML Snippets Powered By : XYZScripts.com