Monitoring Spring Boot

The Spring Boot sensor is automatically deployed and installed after you install the Instana agent.

Supported Versions

Currently, supported versions are Spring Boot 1.x, 2.x, and 3.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. If the health check failed, you can see a warning message that indicates the root cause.

Starting from Spring Boot 2, Spring Boot Actuator provides dependency management and auto-configuration for Micrometer. Depending on the Spring Boot version, different Micrometer metrics are available on the JVM dashboard.

Note: Because Endpoints might contain sensitive information, you must consider carefully when to expose them over HTTP. By default, only the health endpoint is exposed. For more information, see Exposing Endpoints.

To exclude specific endpoints from HTTP, use the following directive:

management.endpoints.web.exposure.exclude=health,info

To exclude all endpoints from HTTP, use the following directive:

management.endpoints.web.exposure.exclude=*

Note: For Spring Boot 3.x, before the application configuration properties can be displayed in the Instana UI, you need to make extra changes in the application.properties file, which is a standard configuration file for a Spring Boot application. Otherwise, these properties are shown as ****** because of sensitive values. For more information, see Sanitize Sensitive Values.

To always show the values as clear text, use the following configuration in the application.properties file:

management.endpoint.env.show-values=ALWAYS

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 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 refer to the steps as described in Configuration for how to enable JMX.