Polish actuator docs markup and formatting

Improve consistency of the asciidoctor markup and formatting for
the actuator section.

See gh-27759
This commit is contained in:
Jay Bryant 2021-09-08 12:18:33 -07:00 committed by Phillip Webb
parent 393081f2e6
commit e44585d89a
6 changed files with 31 additions and 22 deletions

View File

@ -5,7 +5,7 @@ This feature can be very useful for reporting and for implementing a lock-out po
Auditing can be enabled by providing a bean of type `AuditEventRepository` in your application's configuration. Auditing can be enabled by providing a bean of type `AuditEventRepository` in your application's configuration.
For convenience, Spring Boot offers an `InMemoryAuditEventRepository`. For convenience, Spring Boot offers an `InMemoryAuditEventRepository`.
`InMemoryAuditEventRepository` has limited capabilities and we recommend using it only for development environments. `InMemoryAuditEventRepository` has limited capabilities, and we recommend using it only for development environments.
For production environments, consider creating your own alternative `AuditEventRepository` implementation. For production environments, consider creating your own alternative `AuditEventRepository` implementation.

View File

@ -15,7 +15,6 @@ In order to use the endpoint, a valid UAA token must be passed with the request.
=== Disabling Extended Cloud Foundry Actuator Support === Disabling Extended Cloud Foundry Actuator Support
If you want to fully disable the `/cloudfoundryapplication` endpoints, you can add the following setting to your `application.properties` file: If you want to fully disable the `/cloudfoundryapplication` endpoints, you can add the following setting to your `application.properties` file:
[source,yaml,indent=0,subs="verbatim",configprops,configblocks] [source,yaml,indent=0,subs="verbatim",configprops,configblocks]
---- ----
management: management:

View File

@ -1,7 +1,7 @@
[[actuator.enabling]] [[actuator.enabling]]
== Enabling Production-ready Features == Enabling 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 {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 Maven based project, add the following '`Starter`' dependency: To add the actuator to a Maven-based project, add the following '`Starter`' dependency:
[source,xml,indent=0,subs="verbatim"] [source,xml,indent=0,subs="verbatim"]
---- ----

View File

@ -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
[[actuator.endpoints.implementing-custom.web.consumes-predicates]] [[actuator.endpoints.implementing-custom.web.consumes-predicates]]
===== Consumes ===== Consumes
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.
[[actuator.endpoints.implementing-custom.web.produces-predicates]] [[actuator.endpoints.implementing-custom.web.produces-predicates]]
===== Produces ===== Produces
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:
| `livenessstate` | `livenessstate`
| {spring-boot-actuator-module-code}/availability/LivenessStateHealthIndicator.java[`LivenessStateHealthIndicator`] | {spring-boot-actuator-module-code}/availability/LivenessStateHealthIndicator.java[`LivenessStateHealthIndicator`]
| Exposes the "Liveness" application availability state. | Exposes the "`Liveness`" application availability state.
| `readinessstate` | `readinessstate`
| {spring-boot-actuator-module-code}/availability/ReadinessStateHealthIndicator.java[`ReadinessStateHealthIndicator`] | {spring-boot-actuator-module-code}/availability/ReadinessStateHealthIndicator.java[`ReadinessStateHealthIndicator`]
| 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:
[source,yaml,indent=0,subs="verbatim",configprops,configblocks] [source,yaml,indent=0,subs="verbatim",configprops,configblocks]
@ -1028,7 +1028,8 @@ This would make `liveness` available at `/livez` and `readiness` at `readyz` on
[[actuator.endpoints.kubernetes-probes.external-state]] [[actuator.endpoints.kubernetes-probes.external-state]]
==== 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:
[source,yaml,indent=0,subs="verbatim",configprops,configblocks] [source,yaml,indent=0,subs="verbatim",configprops,configblocks]

View File

@ -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:
[source,java,indent=0,subs="verbatim"] [source,java,indent=0,subs="verbatim"]
---- ----
include::{docs-java}/actuator/metrics/export/graphite/MyGraphiteConfiguration.java[] include::{docs-java}/actuator/metrics/export/graphite/MyGraphiteConfiguration.java[]
---- ----
====
@ -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:
[source,java,indent=0,subs="verbatim"] [source,java,indent=0,subs="verbatim"]
---- ----
include::{docs-java}/actuator/metrics/export/jmx/MyJmxConfiguration.java[] include::{docs-java}/actuator/metrics/export/jmx/MyJmxConfiguration.java[]
---- ----
====
@ -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`.
[TIP] [TIP]
==== ====

View File

@ -2,4 +2,4 @@
== What to Read Next == What to Read Next
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>>.