The {spring-boot-code}/spring-boot-project/spring-boot-actuator[`spring-boot-actuator`] module provides all of Spring Boot's production-ready features.
The {spring-boot-code}/spring-boot-project/spring-boot-actuator[`spring-boot-actuator`] module provides all of Spring Boot's production-ready features.
The recommended way to enable the features is to add a dependency on the `spring-boot-starter-actuator` '`Starter`'.
The recommended way to enable the features is to add a dependency on the `spring-boot-starter-actuator` "`Starter`".
.Definition of Actuator
.Definition of Actuator
****
****
@ -9,7 +9,7 @@ An actuator is a manufacturing term that refers to a mechanical device for movin
Actuators can generate a large amount of motion from a small change.
Actuators can generate a large amount of motion from a small change.
****
****
To add the actuator to a Mavenbased project, add the following '`Starter`' dependency:
To add the actuator to a Maven-based project, add the following '`Starter`' dependency:
@ -63,7 +63,7 @@ The following technology-agnostic endpoints are available:
Requires one or more `Liquibase` beans.
Requires one or more `Liquibase` beans.
| `metrics`
| `metrics`
| Shows '`metrics`' information for the current application.
| Shows "`metrics`" information for the current application.
| `mappings`
| `mappings`
| Displays a collated list of all `@RequestMapping` paths.
| Displays a collated list of all `@RequestMapping` paths.
@ -429,7 +429,7 @@ The following configuration permits `GET` and `POST` calls from the `example.com
allowed-methods: "GET,POST"
allowed-methods: "GET,POST"
----
----
TIP: See {spring-boot-actuator-autoconfigure-module-code}/endpoint/web/CorsEndpointProperties.java[CorsEndpointProperties] for a complete list of options.
TIP: See {spring-boot-actuator-autoconfigure-module-code}/endpoint/web/CorsEndpointProperties.java[`CorsEndpointProperties`] for a complete list of options.
@ -547,19 +547,19 @@ The HTTP method of the predicate is determined by the operation type, as shown i
For a `@WriteOperation` (HTTP `POST`) that uses the request body, the consumes clause of the predicate is `application/vnd.spring-boot.actuator.v2+json, application/json`.
For a `@WriteOperation` (HTTP `POST`) that uses the request body, the consumes clause of the predicate is `application/vnd.spring-boot.actuator.v2+json, application/json`.
For all other operations the consumes clause is empty.
For all other operations, the `consumes` clause is empty.
The produces clause of the predicate can be determined by the `produces` attribute of the `@DeleteOperation`, `@ReadOperation`, and `@WriteOperation` annotations.
The `produces` clause of the predicate can be determined by the `produces` attribute of the `@DeleteOperation`, `@ReadOperation`, and `@WriteOperation` annotations.
The attribute is optional.
The attribute is optional.
If it is not used, the produces clause is determined automatically.
If it is not used, the `produces` clause is determined automatically.
If the operation method returns `void` or `Void` the produces clause is empty.
If the operation method returns `void` or `Void`, the `produces` clause is empty.
If the operation method returns a `org.springframework.core.io.Resource`, the produces clause is `application/octet-stream`.
If the operation method returns a `org.springframework.core.io.Resource`, the `produces` clause is `application/octet-stream`.
For all other operations the produces clause is `application/vnd.spring-boot.actuator.v2+json, application/json`.
For all other operations, the `produces` clause is `application/vnd.spring-boot.actuator.v2+json, application/json`.
@ -741,11 +741,11 @@ Additional `HealthIndicators` are available but not enabled by default:
| Exposes the "Readiness" application availability state.
| Exposes the "`Readiness`" application availability state.
|===
|===
@ -886,7 +886,7 @@ Also, any `HealthIndicator` that is not handled explicitly is wrapped automatica
==== Health Groups
==== Health Groups
It's sometimes useful to organize health indicators into groups that can be used for different purposes.
It's sometimes useful to organize health indicators into groups that can be used for different purposes.
To create a health indicator group you can use the `management.endpoint.health.group.<name>` property and specify a list of health indicator IDs to `include` or `exclude`.
To create a health indicator group, you can use the `management.endpoint.health.group.<name>` property and specify a list of health indicator IDs to `include` or `exclude`.
For example, to create a group that includes only database indicators you can define the following:
For example, to create a group that includes only database indicators you can define the following:
==== Checking External State with Kubernetes Probes
==== Checking External State with Kubernetes Probes
Actuator configures the "liveness" and "readiness" probes as Health Groups; this means that all the <<actuator#actuator.endpoints.health.groups, Health Groups features>> are available for them.
Actuator configures the "`liveness`" and "`readiness`" probes as Health Groups.
This means that all the <<actuator#actuator.endpoints.health.groups, health groups features>> are available for them.
You can, for example, configure additional Health Indicators:
You can, for example, configure additional Health Indicators:
@ -294,13 +294,16 @@ The https://graphiteapp.org[Graphite server] host and port to use can be provide
Micrometer provides a default `HierarchicalNameMapper` that governs how a dimensional meter id is {micrometer-registry-docs}/graphite#_hierarchical_name_mapping[mapped to flat hierarchical names].
Micrometer provides a default `HierarchicalNameMapper` that governs how a dimensional meter id is {micrometer-registry-docs}/graphite#_hierarchical_name_mapping[mapped to flat hierarchical names].
TIP: To take control over this behavior, define your `GraphiteMeterRegistry` and supply your own `HierarchicalNameMapper`.
[TIP]
====
To take control over this behavior, define your `GraphiteMeterRegistry` and supply your own `HierarchicalNameMapper`.
An auto-configured `GraphiteConfig` and `Clock` beans are provided unless you define your own:
An auto-configured `GraphiteConfig` and `Clock` beans are provided unless you define your own:
@ -367,13 +370,16 @@ The domain to use can be provided using:
Micrometer provides a default `HierarchicalNameMapper` that governs how a dimensional meter id is {micrometer-registry-docs}/jmx#_hierarchical_name_mapping[mapped to flat hierarchical names].
Micrometer provides a default `HierarchicalNameMapper` that governs how a dimensional meter id is {micrometer-registry-docs}/jmx#_hierarchical_name_mapping[mapped to flat hierarchical names].
TIP: To take control over this behavior, define your `JmxMeterRegistry` and supply your own `HierarchicalNameMapper`.
[TIP]
====
To take control over this behavior, define your `JmxMeterRegistry` and supply your own `HierarchicalNameMapper`.
An auto-configured `JmxConfig` and `Clock` beans are provided unless you define your own:
An auto-configured `JmxConfig` and `Clock` beans are provided unless you define your own:
@ -854,7 +860,8 @@ Data source instrumentation results in gauges representing the currently active,
Metrics are also tagged by the name of the `DataSource` computed based on the bean name.
Metrics are also tagged by the name of the `DataSource` computed based on the bean name.
TIP: By default, Spring Boot provides metadata for all supported data sources; you can add additional `DataSourcePoolMetadataProvider` beans if your favorite data source isn't supported out of the box.
TIP: By default, Spring Boot provides metadata for all supported data sources.
You can add additional `DataSourcePoolMetadataProvider` beans if your favorite data source is not supported.
See `DataSourcePoolMetadataProvidersConfiguration` for examples.
See `DataSourcePoolMetadataProvidersConfiguration` for examples.
Also, Hikari-specific metrics are exposed with a `hikaricp` prefix.
Also, Hikari-specific metrics are exposed with a `hikaricp` prefix.
@ -935,6 +942,7 @@ For more details refer to {spring-kafka-docs}#micrometer-native[Micrometer Nativ
[[actuator.metrics.supported.mongodb]]
[[actuator.metrics.supported.mongodb]]
==== MongoDB Metrics
==== MongoDB Metrics
This section briefly describes the available metrics for MongoDB.
@ -1168,10 +1176,11 @@ For more details on concepts behind `percentiles-histogram`, `percentiles` and `
[[actuator.metrics.endpoint]]
[[actuator.metrics.endpoint]]
=== Metrics Endpoint
=== Metrics Endpoint
Spring Boot provides a `metrics` endpoint that can be used diagnostically to examine the metrics collected by an application.
Spring Boot provides a `metrics` endpoint that can be used diagnostically to examine the metrics collected by an application.
The endpoint is not available by default and must be exposed, see <<actuator#actuator.endpoints.exposing,exposing endpoints>> for more details.
The endpoint is not available by default and must be exposed.
See <<actuator#actuator.endpoints.exposing,exposing endpoints>> for more details.
Navigating to `/actuator/metrics` displays a list of available meter names.
Navigating to `/actuator/metrics` displays a list of available meter names.
You can drill down to view information about a particular meter by providing its name as a selector, e.g. `/actuator/metrics/jvm.memory.max`.
You can drill down to view information about a particular meter by providing its name as a selector -- for example, `/actuator/metrics/jvm.memory.max`.
You might want to read about graphing tools such as https://graphiteapp.org[Graphite].
You might want to read about graphing tools such as https://graphiteapp.org[Graphite].
Otherwise, you can continue on, to read about <<deployment#deployment, '`deployment options`'>> or jump ahead for some in-depth information about Spring Boot's _<<build-tool-plugins#build-tool-plugins, build tool plugins>>_.
Otherwise, you can continue on to read about <<deployment#deployment, "`deployment options`">> or jump ahead for some in-depth information about Spring Boot's <<build-tool-plugins#build-tool-plugins, build tool plugins>>.