spring-boot/spring-boot-project/spring-boot-actuator/README.adoc

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

51 lines
1.8 KiB
Plaintext
Raw Normal View History

2014-06-07 13:16:20 +08:00
= Spring Boot - Actuator
Spring Boot Actuator includes a number of additional features to help you monitor and
manage your application when it's pushed to production. You can choose to manage and
monitor your application using HTTP or JMX endpoints. Auditing, health and metrics
gathering can be automatically applied to your application. The
2018-01-04 00:07:10 +08:00
https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#production-ready[user guide]
2014-06-07 13:16:20 +08:00
covers the features in more detail.
2024-03-20 12:48:48 +08:00
2014-06-07 13:16:20 +08:00
== Enabling the Actuator
2024-03-20 12:48:48 +08:00
The recommended way to enable the features is to add a dependency to the
`spring-boot-starter-actuator` '`Starter`'. To add the actuator to a Maven-based project,
add the following '`Starter`' dependency:
2014-06-07 13:16:20 +08:00
2024-03-20 12:48:48 +08:00
[source,xml]
2014-06-07 13:16:20 +08:00
----
2024-03-20 12:48:48 +08:00
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
</dependencies>
2014-06-07 13:16:20 +08:00
----
For Gradle, use the following declaration:
2014-06-07 13:16:20 +08:00
2024-03-20 12:48:48 +08:00
[source]
2014-06-07 13:16:20 +08:00
----
2024-03-20 12:48:48 +08:00
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-actuator'
}
2014-06-07 13:16:20 +08:00
----
2024-03-20 12:48:48 +08:00
2014-06-07 13:16:20 +08:00
== Features
2024-03-20 12:48:48 +08:00
2014-06-07 13:16:20 +08:00
* **Endpoints** Actuator endpoints allow you to monitor and interact with your
application. Spring Boot includes a number of built-in endpoints and you can also add
your own. For example the `health` endpoint provides basic application health
information. Run up a basic application and look at `/actuator/health`.
* **Metrics** Spring Boot Actuator provides dimensional metrics by integrating with
https://micrometer.io[Micrometer].
2014-06-07 13:16:20 +08:00
* **Audit** Spring Boot Actuator has a flexible audit framework that will publish events
to an `AuditEventRepository`. Once Spring Security is in play it automatically publishes
2014-06-07 13:16:20 +08:00
authentication events by default. This can be very useful for reporting, and also to
implement a lock-out policy based on authentication failures.