Sign inSign up

pleosoft/metrics-exporter

By pleosoft

Updated over 1 year ago

Expose metrics from any remote REST API for Prometheus monitoring. Alfresco ready.

Image
Web servers
Web analytics
0

300

pleosoft/metrics-exporter repository overview

Metrics Exporter is a standalone Spring Boot application that collects and exposes metrics from Alfresco or other "rest apis" for monitoring and observability. It integrates with Micrometer and OpenTelemetry to provide detailed insights about your data, indexing, search operations, and document management. The exporter communicates with Alfresco via REST APIs and makes metrics available for Prometheus, Grafana, and other monitoring systems. Designed for easy deployment, it supports native images with GraalVM and can be run as a Docker container, making it ideal for production environments.

docker command

adapt host.docker.internal to your environment

docker run -p 8081:8081 -e metricsexporter.targets.alfresco.url=http://host.docker.internal:8080/alfresco/api/-default-/public pleosoft/metrics-exporter:1.0.0

use with the latest alfresco docker compose

docker compose

the default port is 8081

  metricsexporter:
    image: pleosoft/metrics-exporter:1.0.0
    mem_limit: 256m
    environment:      
      METRICSEXPORTER_TARGETS_ALFRESCO_URL: http://alfresco:8080/alfresco/api/-default-/public
    ports:
      - "8081:8081"

to access metricsexporter:8081/actuator/prometheus you have to expose the container port

change default sample config

you can use the standard spring mechanism to customize the properties. The simples is to mount the file to /home/cnb otherwise all standard spring boot properties can be used.

environment:
  - SPRING_CONFIG_LOCATION=
otel:
  traces.exporter: none
  metrics.exporter: none
  logs.exporter: none

management:
  web.exposure.include: '*'
  metrics:
    enable:
      http:
        client.requests: true
        server.requests: true

metricsexporter:
  scheduler: 15000
  targets: 
    alfresco:
      url: http://localhost:8080/alfresco/api/-default-/public     
      headers:
        Authorization: Basic YWRtaW46YWRtaW4=      
      api: 
        - path: /search/versions/1/search
          method: POST
          body:
            query:
              query: select * from cmis:folder WHERE CONTAINS ('*')
              language: cmis
            paging:
              maxItems: 1
          metrics:
            - name: cmis.total.cm_folder                          
              extract: "#response.body['list']['pagination']['totalItems']"     

The default sample configuration in the image is:

metricsexporter:
  scheduler: 15000
  targets: 
    alfresco:
      url: http://localhost:8080/alfresco/api/-default-/public     
      headers:
        Authorization: Basic YWRtaW46YWRtaW4=      
      api: 
        - path: /search/versions/1/search
          method: POST
          body:
            query:
              query: select * from cmis:folder WHERE CONTAINS ('*')
              language: cmis
            paging:
              maxItems: 1
          metrics:
            - name: cmis.total.cm_folder                          
              extract: "#response.body['list']['pagination']['totalItems']"
        - path: /search/versions/1/search
          method: POST
          body:
            query:
              query: select * from cmis:document WHERE CONTAINS ('*')
              language: cmis
            paging:
              maxItems: 1
          metrics:           
            - name: cmis.total.cm_content             
              extract: "#response.body['list']['pagination']['totalItems']"
            - name: cmis.total.cm_content2               
              extract: "#response.body['list']['pagination']['totalItems']"  
        - path: /search/versions/1/search
          method: POST
          body:
            query:
              query: +TYPE:"cm:content" AND ISNODE:T
              language: afts
            paging:
              maxItems: 1
          metrics:           
            - name: afts.total.cm_content       
              extract: "#response.body['list']['pagination']['totalItems']"
        - path: /search/versions/1/search
          method: POST
          body:
            query:
              query: +TYPE:"cm:folder" AND ISNODE:T
              language: afts
            paging:
              maxItems: 1
          metrics:           
            - name: afts.total.cm_folder               
              extract: "#response.body['list']['pagination']['totalItems']"   

metrics

available at /actuator/metrics and /actuator/prometheus

every configured metric will be prefixed with the "target" name and the "metric" name, like alfresco_afts_total_cm_content or alfresco_afts_total_cm_folder from the default configuration.

License

This software is provided free of charge for use, but without any warranty. It is built as a native image on top of Spring Framework libraries and Spring Boot. The software includes no third-party software except for Spring Framework libraries, OpenTelemetry/Micrometer, and proprietary code developed by Pleo Soft d.o.o.

The source code for the Docker image (non-native images) and Windows executables is available to customers upon request. The binaries are distributed under an unlockable source code license, allowing free usage with limitations on access to the source code.

Tag summary

Content type

Image

Digest

sha256:6fba2fc0b

Size

49 MB

Last updated

over 1 year ago

docker pull pleosoft/metrics-exporter:1.0.0