Disable Tomcat's MBean Registry by default

Closes gh-16498
This commit is contained in:
Andy Wilkinson
2019-05-21 17:00:53 +01:00
parent 080a2f5c3b
commit b603cd5d4b
9 changed files with 119 additions and 16 deletions

View File

@@ -1075,6 +1075,20 @@ include::{code-examples}/context/embedded/TomcatLegacyCookieProcessorExample.jav
[[howto-enable-tomcat-mbean-registry]]
=== Enable Tomcat's MBean Registry
Embedded Tomcat's MBean registry is disabled by default. This minimizes Tomcat's memory
footprint. If you want to use Tomcat's MBeans, for example so that they can be used to
expose metrics via Micrometer, you must use the `server.tomcat.mbeanregistry.enabled`
property to do so, as shown in the following example:
[source,properties,indent=0]
----
server.tomcat.mbeanregistry.enabled=true
----
[[howto-enable-multiple-listeners-in-undertow]]
=== Enable Multiple Listeners with Undertow
Add an `UndertowBuilderCustomizer` to the `UndertowServletWebServerFactory` and

View File

@@ -1793,7 +1793,8 @@ Spring Boot registers the following core metrics when applicable:
* Logback metrics: record the number of events logged to Logback at each level
* Uptime metrics: report a gauge for uptime and a fixed gauge representing the
application's absolute start time
* Tomcat metrics
* Tomcat metrics (`server.tomcat.mbeanregistry.enabled` must be set to `true` for all
Tomcat metrics to be registered)
* https://docs.spring.io/spring-integration/docs/current/reference/html/system-management-chapter.html#micrometer-integration[Spring Integration] metrics