The metrics endpoint shows some of the important metrics pertaining to the following:
- Server: Free memory, processors, uptime, and so on
- JVM: Details about the heap, threads, garbage collection, sessions, and so on
- Responses provided by application services
An extract from the response of the /actuator/metrics endpoint is as follows:
{
"names":[
"jvm.memory.max",
"jvm.threads.states",
"http.server.requests",
//Lot of other values
"tomcat.global.received",
"process.uptime",
"tomcat.sessions.rejected",
"process.cpu.usage",
//Lot of other values
"process.start.time"
]
}
The metrics service returns the list of metrics. To get a specific metric value, you would need to use the /actuator/metrics/{METRIC-NAME} URI. {METRIC-NAME} should be replaced by the appropriate name from the preceding response.
For example, the /actuator/metrics/jvm.memory.max URI will return the following response:
{ "name": "jvm.memory.max", "description": "The maximum amount of memory in bytes that can be used for memory management", "baseUnit": "bytes", "measurements": [{ "statistic": "VALUE", "value": 5600444415 }], "availableTags": [{ "tag": "area", "values": ["heap", "nonheap"] }, { "tag": "id", "values": ["Compressed Class Space", "PS Survivor Space", "PS Old Gen", "Metaspace", "PS Eden Space", "Code Cache"] }] }