@@ -155,10 +155,10 @@ in your `ApplicationContext`. Spring Boot includes a number of auto-configured
155
155
156
156
=== Security with HealthIndicators
157
157
Information returned by `HealthIndicators` is often somewhat sensitive in nature. For
158
- example and you probably don't want to publish details of your database server to the
159
- world. For this reason, by default, only the health status is exposed on an insecure HTTP
160
- connection. If you are happy for complete heath information to always be exposed you can
161
- set `endpoints.health.sensitive` to `false`.
158
+ example, you probably don't want to publish details of your database server to the
159
+ world. For this reason, by default, only the health status is exposed over an
160
+ unauthenticated HTTP connection. If you are happy for complete heath information to always
161
+ be exposed you can set `endpoints.health.sensitive` to `false`.
162
162
163
163
Heath responses are also cached to prevent "`denial of service`" attacks. Use the
164
164
`endpoints.health.time-to-live` property if you want to change the default cache period
@@ -169,6 +169,7 @@ of 1000 milliseconds.
169
169
==== Auto-configured HealthIndicators
170
170
The following `HealthIndicators` are auto-configured by Spring Boot when appropriate:
171
171
172
+ [cols="1,4"]
172
173
|===
173
174
|Name |Description
174
175
@@ -220,9 +221,9 @@ additional details to be displayed.
220
221
}
221
222
----
222
223
223
- In addition to Spring Boot's default {sc-spring-boot-actuator}/health/Status.{sc-ext}[`Status`]
224
- types, it is also possible to introduce custom `Status` types to represent more
225
- complex system states . In such cases a custom implementation of the
224
+ In addition to Spring Boot's predefined {sc-spring-boot-actuator}/health/Status.{sc-ext}[`Status`]
225
+ types, it is also possible for `Health` to return a custom `Status` that represents a
226
+ new system state . In such cases a custom implementation of the
226
227
{sc-spring-boot-actuator}/health/HealthAggregator.{sc-ext}[`HealthAggregator`]
227
228
interface also needs to be provided, or the default implementation has to be configured
228
229
using the `management.health.status.order` configuration property.
@@ -277,7 +278,7 @@ Maven '`project properties`' via `@..@` placeholders, e.g.
277
278
project.name=Demo
278
279
project.version=X.X.X.X
279
280
project.description=Demo project for info endpoint
280
- info.build.artifact=${ project.artifactId}
281
+ info.build.artifact=@ project.artifactId@
281
282
282
283
283
284
@@ -367,16 +368,17 @@ for Gradle users, although a little more work is required to generate the proper
367
368
[[production-ready-monitoring]]
368
369
== Monitoring and management over HTTP
369
370
If you are developing a Spring MVC application, Spring Boot Actuator will auto-configure
370
- all non-sensitive endpoints to be exposed over HTTP. The default convention is to use the
371
+ all enabled endpoints to be exposed over HTTP. The default convention is to use the
371
372
`id` of the endpoint as the URL path. For example, `health` is exposed as `/health`.
372
373
373
374
374
375
375
376
[[production-ready-sensitive-endpoints]]
376
- === Exposing sensitive endpoints
377
- If you use '`Spring Security`' sensitive endpoints will be exposed over HTTP, but also
378
- protected. By default '`basic`' authentication will be used with the username `user`
379
- and a generated password (which is printed on the console when the application starts).
377
+ === Securing sensitive endpoints
378
+ If you add '`Spring Security`' to you project, all sensitive endpoints exposed over HTTP
379
+ will be protected. By default '`basic`' authentication will be used with the username
380
+ `user` and a generated password (which is printed on the console when the application
381
+ starts).
380
382
381
383
TIP: Generated passwords are logged as the application starts. Search for '`Using default
382
384
security password`'.
@@ -760,6 +762,23 @@ NOTE: In this example we are actually accessing the endpoint over HTTP using the
760
762
761
763
762
764
765
+ [[production-ready-system-metrics]]
766
+ === System metrics
767
+ The following system metrics are exposed by Spring Boot:
768
+
769
+ * The total system memory in Kb (`mem`)
770
+ * The amount of free memory in Kb (`mem.free`)
771
+ * The number of processors (`processors`)
772
+ * The system uptime in milliseconds (`uptime`)
773
+ * The application context uptime in milliseconds (`instance.uptime`)
774
+ * The average system load (`systemload.average`)
775
+ * Heap information in Kb (`heap`, `heap.committed`, `heap.init`, `heap.used`)
776
+ * Thread information (`threads`, `thread.peak`, `thead.daemon`)
777
+ * Class load information (`classes`, `classes.loaded`, `classes.unloaded`)
778
+ * Garbage collection information (`gc.xxx.count`, `gc.xxx.time`)
779
+
780
+
781
+
763
782
[[production-ready-datasource-metrics]]
764
783
=== DataSource metrics
765
784
The following metrics are exposed for each supported `DataSource` defined in your
@@ -788,6 +807,14 @@ beans if your favorite data source isn't supported out of the box. See
788
807
789
808
790
809
810
+ [[production-ready-session-metrics]]
811
+ === Tomcat session metrics
812
+ If you are using Tomcat as your embedded servlet container, session metrics will
813
+ automatically be exposed. The `httpsessions.active` and `httpsessions.max` keys provide
814
+ the number of active and maximum sessions.
815
+
816
+
817
+
791
818
[[production-ready-recording-metrics]]
792
819
=== Recording your own metrics
793
820
To record your own metrics inject a
@@ -857,14 +884,16 @@ an `Exporter` interface and a few basic implementations for you to get started w
857
884
858
885
859
886
[[production-ready-code-hale-metrics]]
860
- === Coda Hale Metrics
861
- User of the http://metrics.codahale.com/[Coda Hale '`Metrics`' library] will automatically
862
- find that Spring Boot metrics are published to `com.codahale.metrics.MetricRegistry`. A
863
- default `com.codahale.metrics.MetricRegistry` Spring bean will be created when you declare
864
- a dependency to the `com.codahale.metrics:metrics-core` library; you can also register you
865
- own `@Bean` instance if you need customizations.
866
-
867
- Users can create Coda Hale metrics by prefixing their metric names with the appropriate
887
+ === Dropwizard Metrics
888
+ User of the https://dropwizard.github.io/metrics/[Dropwizard '`Metrics`' library] will
889
+ automatically find that Spring Boot metrics are published to
890
+ `com.codahale.metrics.MetricRegistry`. A default `com.codahale.metrics.MetricRegistry`
891
+ Spring bean will be created when you declare a dependency to the
892
+ `io.dropwizard.metrics:metrics-core` library; you can also register you own `@Bean`
893
+ instance if you need customizations. Metrics from the `MetricRegistry` are also
894
+ automatically exposed via the `/metrics` endpoint
895
+
896
+ Users can create Dropwizard metrics by prefixing their metric names with the appropriate
868
897
type (e.g. `+histogram.*+`, `+meter.*+`).
869
898
870
899
0 commit comments