I'm using Drowpizard 0.7.1, but perhaps I will upgrade to 0.8.4 very soon.
Does anyone know how to add a admin resource to dropwizard, that is shown in Operational Menu like the example below?
Operational Menu
Metrics
Ping
Threads
Healthcheck
CustomAdminXy
I don't think you can do this easily.
The AdminServlet
is created when the ServerFactory
is built. It may be possible to extend DefaultServerFactory
and override createAdminServlet
to create a custom Admin servlet with your links etc... (You would then have to set your server factory via configuration.)
It seems like this would involve some duplication of code and could be quite fragile.
It might be easier to just register your own admin servlet (in addition to the regular one), e.g.:
environment.admin().addServlet("custom-admin", new CustomAdminServlet())
.addMapping("/custom-admin");
Probably not ideal either.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With