Class ManagementService

java.lang.Object
com.linecorp.armeria.server.AbstractHttpService
com.linecorp.armeria.server.management.ManagementService
All Implemented Interfaces:
Unwrappable, HttpService, Service<HttpRequest,HttpResponse>

@UnstableApi public final class ManagementService extends AbstractHttpService
An HttpService that provides monitoring and management features. First, you need to bind a ManagementService under a path.

 Server.builder()
       .serviceUnder("/internal/management/", ManagementService.of())
 

Thread dump

You can dump the thread information for all live threads with stack trace by accessing "/jvm/threaddump". If MediaType.JSON is specified in HttpHeaderNames.ACCEPT, the thread information will be converted to a JSON. Otherwise, the thread dump will be converted to a plain text.

 // Exports thread information as a JSON array
 curl -L -H "Accept: application/json" http://my-service.com/internal/management/jvm/threaddump
 // Exports thread information as a plain text
 curl -L -H "Accept: text/plain" http://my-service.com/internal/management/jvm/threaddump
 

Heap dump

You can also dump the heap in the same format as the hprof heap dump by accessing "/jvm/heapdump".

 curl -L http://my-service.com/internal/management/jvm/heapdump -o heapdump.hprof
 // Dump only live objects that are reachable from others
 curl -L http://my-service.com/internal/management/jvm/heapdump?live=true -o heapdump.hprof