The Spring Boot integration is used to fetch observability data from Spring Boot Actuator web endpoints and ingest it into Elasticsearch.
Use the Spring Boot integration to:
- Collect logs related to the auditevents and httptrace and metrics related to the gc, memory and threading.
- Create visualizations to monitor, measure and analyze the usage trend and key data, and derive business insights.
- Create alerts to reduce the MTTD and also the MTTR by referencing relevant logs when troubleshooting an issue.
The Spring Boot integration collects logs and metrics data.
Logs help you keep a record of events that happen on your machine. The Log
data streams collected by Spring Boot integration are auditevents
and httptrace
, so that users can keep track of authentication events, HTTP request and response details, enabling comprehensive monitoring and security auditing.
Metrics give you insight into the statistics of the Spring Boot. Metrics data streams collected by the Spring Boot integration include auditevents, gc, httptrace, memory and threading so that the user can monitor and troubleshoot the performance of the Spring Boot instances.
Data streams:
auditevents
: Collects information related to the authentication status, remote address, document ID and principal.gc
: Collects information related to the gc collector name, memory usage before and after collection, thread count and time metrics.httptrace
: Collects information related to the http requests, status response, principal and session details.memory
: Collects information related to the heap and non-heap memory, buffer pool and manager.threading
: Collects information related to the thread allocations, monitoring and CPU times.
Note:
- Users can monitor and see the log inside the ingested documents for Spring Boot in the
logs-*
index pattern fromDiscover
, and for metrics, the index pattern ismetrics-*
.
This integration has been tested against Spring Boot v2.7.17 with LTS JDK versions 8, 11, 17, and 21.
You need Elasticsearch for storing and searching your data and Kibana for visualizing and managing it. You can use our hosted Elasticsearch Service on Elastic Cloud, which is recommended or self-manage the Elastic Stack on your own hardware.
In order to ingest data from Spring Boot:
- You must know the host for Spring Boot application, add that host while configuring the integration package.
- Add default path for jolokia.
- Spring-boot-actuator module provides all Spring Boot's production-ready features. So add below dependency in
pom.xml
file.
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
- For access of jolokia add below dependency in
pom.xml
of Spring Boot Application.
<dependency>
<groupId>org.jolokia</groupId>
<artifactId>jolokia-core</artifactId>
</dependency>
- To expose
HTTP Trace
metrics following class can be used InMemoryHttpTraceRepository. - To expose
Audit Events
metrics following class can be used InMemoryAuditEventRepository.
For step-by-step instructions on how to set up an integration, see the Getting Started guide.
After the integration is successfully configured, click on the Assets tab of the Spring Boot Integration to display the available dashboards. Select the dashboard for your configured data stream, which should be populated with the required data.
- If [Spring Boot] Audit Events panel does not display older documents after upgrading to
0.9.0
or later versions, this issue can be resolved by reindexing theAudit Events
data stream. - If
host.ip
appears conflicted under thelogs-*
data view, this issue can be resolved by reindexing theAudit Events
data stream. - If
host.ip
appears conflicted under themetrics-*
data view, this issue can be resolved by reindexing theGarbage Collector
,Memory
andThreading
data stream.
This is the audit_events
data stream.
- This data stream exposes audit events information for the current application.
{{event "audit_events"}}
{{fields "audit_events"}}
This is the http_trace
data stream.
- This data stream displays HTTP trace information.
{{event "http_trace"}}
{{fields "http_trace"}}
This is the memory
data stream.
- This data stream gives metrics related to heap and non-heap memory, buffer pool and manager.
{{event "memory"}}
{{fields "memory"}}
This is the threading
data stream.
- This data stream gives metrics related to thread allocations, monitoring and CPU times.
{{event "threading"}}
{{fields "threading"}}
This is the gc
data stream.
- This data stream gives metrics related to Garbage Collector (GC) Memory.
{{event "gc"}}
{{fields "gc"}}