Spring Boot Actuator JMX Metrics Exporter

Library to export JMX MBean attributes as Spring Boot Actuator metrics

Лицензия

Лицензия

Категории

Категории

Spring Boot Контейнер Микросервисы Сеть Metrics Тестирование приложения и мониторинг Monitoring
Группа

Группа

net.bjohannsen
Идентификатор

Идентификатор

spring-boot-actuator-jmx-metrics-exporter
Последняя версия

Последняя версия

2.0.1-RELEASE
Дата

Дата

Тип

Тип

jar
Описание

Описание

Spring Boot Actuator JMX Metrics Exporter
Library to export JMX MBean attributes as Spring Boot Actuator metrics
Ссылка на сайт

Ссылка на сайт

https://github.com/bjohannsen/spring-boot-actuator-jmx-metrics-exporter
Система контроля версий

Система контроля версий

https://github.com/bjohannsen/spring-boot-actuator-jmx-metrics-exporter

Скачать spring-boot-actuator-jmx-metrics-exporter

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/net.bjohannsen/spring-boot-actuator-jmx-metrics-exporter/ -->
<dependency>
    <groupId>net.bjohannsen</groupId>
    <artifactId>spring-boot-actuator-jmx-metrics-exporter</artifactId>
    <version>2.0.1-RELEASE</version>
</dependency>
// https://jarcasting.com/artifacts/net.bjohannsen/spring-boot-actuator-jmx-metrics-exporter/
implementation 'net.bjohannsen:spring-boot-actuator-jmx-metrics-exporter:2.0.1-RELEASE'
// https://jarcasting.com/artifacts/net.bjohannsen/spring-boot-actuator-jmx-metrics-exporter/
implementation ("net.bjohannsen:spring-boot-actuator-jmx-metrics-exporter:2.0.1-RELEASE")
'net.bjohannsen:spring-boot-actuator-jmx-metrics-exporter:jar:2.0.1-RELEASE'
<dependency org="net.bjohannsen" name="spring-boot-actuator-jmx-metrics-exporter" rev="2.0.1-RELEASE">
  <artifact name="spring-boot-actuator-jmx-metrics-exporter" type="jar" />
</dependency>
@Grapes(
@Grab(group='net.bjohannsen', module='spring-boot-actuator-jmx-metrics-exporter', version='2.0.1-RELEASE')
)
libraryDependencies += "net.bjohannsen" % "spring-boot-actuator-jmx-metrics-exporter" % "2.0.1-RELEASE"
[net.bjohannsen/spring-boot-actuator-jmx-metrics-exporter "2.0.1-RELEASE"]

Зависимости

runtime (8)

Идентификатор библиотеки Тип Версия
io.micrometer : micrometer-core jar 1.0.10
org.slf4j : slf4j-api jar 1.7.26
org.springframework : spring-context jar 5.0.13.RELEASE
org.springframework.boot : spring-boot-actuator jar 2.0.9.RELEASE
org.springframework.boot : spring-boot-autoconfigure jar 2.0.9.RELEASE
com.fasterxml.jackson.core : jackson-core jar 2.9.8
com.fasterxml.jackson.core : jackson-annotations jar 2.9.0
com.fasterxml.jackson.core : jackson-databind jar 2.9.8

Модули Проекта

Данный проект не имеет модулей.

Build Build Maven Central

spring-boot-actuator-jmx-metrics-exporter

Glue Library to publish JMX MBean attributes as Spring Actuator metrics. Supports simple attribute values that can be parsed as a Number as well as composite attribute types.

It reads configured attributes from MBeans and submits them to the Spring Boot Actuator metrics system (i.e. Micrometer). The JMX data is scraped in a configurable interval to avoid performance issues.

How to use

Add dependency:

runtime 'net.bjohannsen:spring-boot-actuator-jmx-metrics-exporter:2.0.1-RELEASE")

Requirements:

  • Java 11 or higher
  • Micrometer (Spring Boot2 Actuator or Spring Boot 1.5 with Micrometer Legacy adapter)
  • Jmx should be enabled in spring config ((spring.jmx.enabled=true). It is disabled by default since Spring Boot 2.2)

Configuration

Configuration property prefix is 'jmx-metrics-export'.

Properties

Key Default Description
enabled false Enable metrics
prefix jmx Prefix for exposed metrics
scrape-interval 10000 Interval to scrape data from MBeans in milliseconds
config-files classpath:jmx-metrics-exporter.json List of resource links to mbean config json files (see below)

jmx-metrics-exporter.json

{
  "prefix": "jmx",
  "mbeans": [
    {
      "mbeanName": "net.bjohannsen.spring.boot.actuator.metrics.jmxexporter:name=mBean,type=MBeanClass",
      "metricName": "myMetric",
      "attributes": ["SomeAttribute", "AnotherAttribute"]
    }
  ]
}

The example will expose metrics 'jmx.myMetric.SomeAttribute' and 'jmx.myMetric.AnotherAttribute'. Multiple config files can be specified and will be used in an additive manner.

Composite types

To export composite type members, simply config the attribute as 'attributeName.memberKey' format. Example:

...
  "mbeans": [
    {
      "mbeanName": "java.lang:type=Memory",
      "metricName": "memory",
      "attributes": ["HeapMemoryUsage.max"]
    }
  ]
...

Examples

Example configurations for application.yml and config files can be found in the application-test.yml and mbean-metrics-config.json.

Версии библиотеки

Версия
2.0.1-RELEASE
2.0.0-RELEASE
1.1.1-RELEASE
1.1.0-RELEASE
1.0.0-RELEASE