My team is currently evaluating the embedded Undertow within Spring Boot. One concern that has come up which is that it does not appear as though Undertow exposes its internal metrics (active connections, active requests, etc.) via the MeterRegistry.

Additionally, the UndertowWebServer class does not expose the underlying Undertow server object in the same way that TomcatWebServer and JettyWebServer expose their underlying server objects.

What we'd like to have is either Spring support for Undertow internal metrics from the ConnectorStatistics (similar to the TomcatMetricsBinder and AbstractJettyMetricsBinder) or at least have the Undertow object exposed via the UndertowWebServer class so that we could expose those metrics ourselves.

Comment From: wilkinsona

We don't have any metrics support for Undertow as there's no Micrometer integration. That's been discussed in https://github.com/micrometer-metrics/micrometer/issues/1227. It's now waiting for some traction with the Undertow maintainers (https://issues.redhat.com/browse/UNDERTOW-2294 and https://groups.google.com/g/undertow-dev/c/4H_qXOlqTw0?pli=1) which can often be quite hard to get. You may want to keep this responsiveness in mind when considering your choice of embedded web server.

I'm not sure that we'd want to make the Undertow instance accessible through UndertowWebServer as it's lifecycle is more complex than either Tomcat or Jetty such that has to be mutable and will be null until the server's been started. I'll discuss it with the rest of the team and see what they think.

Comment From: isaacirvin

Thanks for the response and candor @wilkinsona! I'm definitely interested in hearing what the team thinks.

As far as the responsiveness goes from Undertow maintainers is there a sense of how long requests like this usually take to have implemented on the Undertow side?

Comment From: wilkinsona

As far as the responsiveness goes from Undertow maintainers is there a sense of how long requests like this usually take to have implemented on the Undertow side?

I think it's best if you draw your own conclusions there. You can look at the project's issue tracker and Google group to inform your view.

Comment From: philwebb

We're going to add getUndertow() to UndertowWebServer but we'll document that it will be null until the server has been started. As such, it will be best to use something like the WebServerInitializedEvent to access it (so you don't get null).

Issue #3016 could improve things in the future and mean that we can make getUndertow() behave in a similar way to getTomcat() on TomcatWebServer.

Comment From: isaacirvin

Thanks so much @philwebb! That will be incredibly helpful!

Comment From: mhalbritter

Superseded by https://github.com/spring-projects/spring-boot/pull/39916.