Monitoring Alfresco SOLR with Prometheus and Grafana

Showing results for 
Search instead for 
Did you mean: 

Monitoring Alfresco SOLR with Prometheus and Grafana

Alfresco Employee
9 3 7,314

Apache SOLR provides a Metrics Reporting REST API from 6.4.0 release. This API can be accessed using the following handler:


  <lst name="metrics">
    <lst name="solr.jetty">
      <lst name="org.eclipse.jetty.server.handler.DefaultHandler.1xx-responses">
        <long name="count">0</long>
        <double name="meanRate">0.0</double>
        <double name="1minRate">0.0</double>
        <double name="5minRate">0.0</double>
        <double name="15minRate">0.0</double>

SOLR provides different types of metrics (counter, meter, histogram, timer and gauge) that are exposed in groups of categories (jvm, jetty, node and core). Additionally, some out of the box reporters are available to export this metrics to analisys tools like SLF4J, Graphite, Ganglia and Prometheus.

Since Alfresco Search Services 1.4 is built on top of Apache Solr 6.6.5, this REST API can be used to monitor service performance.

SOLR Prometheus Exporter

Prometheus exporter is available from SOLR 7.3.0:

This application is a REST API that exposes SOLR Metrics in a Prometheus compliant format.



# HELP solr_ping See following URL:
# TYPE solr_ping gauge
solr_ping{base_url="http://solr6:8983/solr",core="alfresco",} 1.0
solr_ping{base_url="http://solr6:8983/solr",core="archive",} 1.0
# HELP solr_metrics_jetty_response_total See following URL:
# TYPE solr_metrics_jetty_response_total counter
solr_metrics_jetty_response_total{base_url="http://solr6:8983/solr",status="1xx",} 0.0
solr_metrics_jetty_response_total{base_url="http://solr6:8983/solr",status="2xx",} 715.0
solr_metrics_jetty_response_total{base_url="http://solr6:8983/solr",status="3xx",} 0.0
solr_metrics_jetty_response_total{base_url="http://solr6:8983/solr",status="4xx",} 0.0
solr_metrics_jetty_response_total{base_url="http://solr6:8983/solr",status="5xx",} 0.0

Prometheus exporter is able to parse SOLR Metrics JSON response in order to provide a subset of metrics by using an XML configuration file.

      <lst name="request">
        <lst name="query">
          <str name="path">/admin/metrics</str>
          <lst name="params">
            <str name="group">all</str>
            <str name="type">all</str>
            <str name="prefix"></str>
            <str name="property"></str>
        <arr name="jsonQueries">
            .metrics["solr.jetty"] | to_entries | .[] | select(.key | startswith("org.eclipse.jetty.server.handler.DefaultHandler")) | select(.key | endswith("xx-responses")) as $object |
            $object.key | split(".") | last | split("-") | first as $status |
            $object.value.count as $value |
            name         : "solr_metrics_jetty_response_total",
            type         : "COUNTER",
            help         : "See following URL:",
            label_names  : ["status"],
            label_values : [$status],
            value        : $value

By using this configuration, SOLR Metrics from SOLR 6.6.5 release can be consumed even using a 7.3.0 Prometheus Exporter version.

Prometheus and Grafana

Once the SOLR Exporter is producing the right format for Prometheus, a new target can be declared in Prometheus configuration file.

  scrape_interval:     15s
  evaluation_interval: 15s



  - job_name: 'solr'

      - targets: ['solr-exporter:9854']

And Grafana can use this data source to build a Monitoring Dashboard.


Grafana Dashboard for Alfresco SOLR MonitoringGrafana Dashboard for Alfresco SOLR Monitoring

Putting it all together

A Docker Compose template has been provided to test this configuration with Alfresco:

Once the composition is running, not only Alfresco services are available, but also Prometheus Exporter, Prometheus and Grafana are living.

So you can test your ACS 6.2 stack accessing to:

http://localhost:8080/share         - Alfresco Share WebApp
http://localhost:8080/alfresco      - Alfresco Repository
http://localhost:8083/solr          - Alfresco Search Services

And the Monitoring services in:

http://localhost:9854     - Solr Exporter metrics
http://localhost:9090     - Prometheus UI
http://localhost:3000 - Grafana UI


Extending this base configuration, several customizations can be deployed:

  • Prometheus exporter configurations in order to provide different subsets of metrics. For instance, monitoring a bulk ingestion might be different from monitoring a searching system.
  • Different Grafana dashboards can be built in order to visualize groups of metrics related with performance, resources consumption or cache usage.
About the Author
Angel Borroy is Hyland Developer Evangelist. Over the last 15 years, he has been working as a software architect on Java, BPM, document management and electronic signatures. He has been working with Alfresco during the last years to customize several implementations in large organizations and to provide add-ons to the Community based on Record Management and Electronic Signature. He writes (sometimes) on his personal blog He is (proud) member of the Order of the Bee.