Monitoring Spring Boot

Supported Versions

Currently, supported versions are Spring Boot 1.x and 2.x.

Configuration

Spring Boot monitoring requires that Spring Boot Actuator is configured:

<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-actuator</artifactId>
</dependency>

For Spring Boot 2.2.x and later it's necessary to enable JMX in the application.properties:

spring.jmx.enabled=true

In case the endpoints are disabled in the application.properties with:

management.endpoints.enabled-by-default=false

it is necessary to expose the Spring Boot management MBeans by enabling the following endpoints:

management.endpoint.info.enabled=true
management.endpoint.health.enabled=true
management.endpoint.metrics.enabled=true
management.endpoint.env.enabled=true

Instana queries metrics from the Spring Boot management MBean org.springframework.boot:type=Endpoint,name=Metrics and there's no need to configure authentication/credentials for secured actuator endpoints.

By default, Instana queries the health of the Spring Boot app every 10 minutes by querying the management MBean org.springframework.boot:type=Endpoint,name=Health. If needed, the desired health-interval in seconds can be configured:

com.instana.plugin.springboot:
  health-interval: 30

Note: The health check can introduce new downstream calls, depending on the health check implementation. In case the health check failed, a warning message is logged indicating the root cause.

Naming Spring Boot Apps

Instana extracts the name for the Spring Boot instances leveraging the build-info.properties file. It can be generated for example with the spring-boot-maven-plugin:

<plugin>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-maven-plugin</artifactId>
  <configuration>
    <executable>true</executable>
  </configuration>
  <executions>
    <execution>
      <goals>
        <goal>build-info</goal>
      </goals>
      <configuration>
        <additionalProperties>
          <name>${project.artifactId}</name>
          <version>${project.version}</version>
        </additionalProperties>
      </configuration>
    </execution>
  </executions>
</plugin>

See https://docs.spring.io/autorepo/docs/spring-boot/current/maven-plugin/reference/html/#build-info for details.

Alternatively, you can also set spring.application.name in your application config. This requires the Spring Boot Actuator to be configured (see previous section).

Metrics collection

Configuration data

  • Name
  • Application Version
  • Spring Boot Version
  • Status
  • Port
  • HTTP Session Limit
  • Application Configuration

Performance metrics

Metric Description Granularity
Endpoint Request/Response Breakdown The number of requests per second for each response status code
(1xx, 2xx, 3xx, 4xx, 5xx)
1 second
HTTP Sessions The number of active HTTP sessions 1 second

Health Signatures

For each sensor, there is a curated knowledgebase of health signatures that are evaluated continuously against the incoming metrics and are used to raise issues or incidents depending on user impact.

Built-in events trigger issues or incidents based on failing health signatures on entities, and custom events trigger issues or incidents based on the thresholds of an individual metric of any given entity.

For information about built-events for the Spring Boot sensor, see the Built-in events reference.

Troubleshooting

Spring Boot Actuator is not configured

Monitoring issue type: springboot_actuator_not_configured

To resolve this issue please refer to the steps as described in Configuration for how to configure Spring Boot Actuator.

JMX is not enabled

Monitoring issue type: springboot_jmx_not_enabled

To resolve this issue please refer to the steps as described in Configuration for how to enable JMX.