Skip to main content

Java Spring Boot 2 application collector

This module monitors one or more Java Spring-boot 2 applications depending on configuration. Netdata can be used to monitor running Java Spring Boot 2 applications that expose their metrics with the use of the Spring Boot Actuator included in Spring Boot library.

Springboot2 module looks up http://localhost:8080/actuator/prometheus and http://127.0.0.1:8080/actuator/prometheus to detect Spring Boot application by default.

Metrics

All metrics have "springboot2." prefix.

MetricScopeDimensionsUnits
response_codesglobal1xx, 2xx, 3xx, 4xx, 5xxrequests/s
threadglobaldaemon, totalthreads
heapglobalfree, eden, survivor, oldB
heap_edenglobalused, commitedB
heap_survivorglobalused, commitedB
heap_oldglobalused, commitedB
uptimeglobaluptimeseconds

Configuration

Edit the go.d/springboot2.conf configuration file using edit-config from the Netdata config directory, which is typically at /etc/netdata.

cd /etc/netdata # Replace this path with your Netdata config directory
sudo ./edit-config go.d/springboot2.conf

The Spring Boot Actuator exposes these metrics over HTTP and is very easy to use:

  • add org.springframework.boot:spring-boot-starter-actuator and io.micrometer:micrometer-registry-prometheus to your application dependencies
  • set management.endpoints.web.exposure.include=* in your application.properties

Please refer to the Spring Boot Actuator: Production-ready features and 81. Actuator - Part IX. ‘How-to’ guides for more information.

Here is an example for 2 servers:

jobs:
- name: local
url: http://localhost:8080/actuator/prometheus

- name: remote
url: http://203.0.113.10:8080/actuator/prometheus

For all available options please see module configuration file.

Troubleshooting

To troubleshoot issues with the springboot2 collector, run the go.d.plugin with the debug option enabled. The output should give you clues as to why the collector isn't working.

  • Navigate to the plugins.d directory, usually at /usr/libexec/netdata/plugins.d/. If that's not the case on your system, open netdata.conf and look for the plugins setting under [directories].

    cd /usr/libexec/netdata/plugins.d/
  • Switch to the netdata user.

    sudo -u netdata -s
  • Run the go.d.plugin to debug the collector:

    ./go.d.plugin -d -m springboot2

Do you have any feedback for this page? If so, you can open a new issue on our netdata/learn repository.