- Mastering Spring Boot 2.0
- Dinesh Rajput
- 213字
- 2021-06-25 21:29:19
Exposing metrics endpoints
Spring Boot Actuator allows you to inspect some interesting parameters of your running application, such as application memory circumstances (available versus free). The following listing shows a sample of what the /metrics endpoint might give you:
{ mem: 308564, mem.free: 219799, processors: 4, instance.uptime: 3912392, uptime: 3918108, systemload.average: -1, heap.committed: 254976, heap.init: 131072, heap.used: 35176, heap: 1847808, nonheap.committed: 54952, nonheap.init: 2496, nonheap.used: 53578, nonheap: 0, threads.peak: 25, threads.daemon: 23, threads.totalStarted: 29, threads: 25, classes: 6793, classes.loaded: 6793, classes.unloaded: 0, gc.ps_scavenge.count: 8, gc.ps_scavenge.time: 136, gc.ps_marksweep.count: 2, gc.ps_marksweep.time: 208, httpsessions.max: -1, httpsessions.active: 0, gauge.response.beans: 20, gauge.response.env: 16, gauge.response.autoconfig: 14, gauge.response.unmapped: 1, counter.status.200.beans: 2, counter.login.failure: 2,
counter.login.success: 10, counter.status.200.autoconfig: 2, counter.status.401.unmapped: 3, counter.status.200.env: 2 }
As you can see, a lot of information is provided by the /metrics endpoint.
Now let's check the health of the application by using the /health endpoint:
{ status: "UP", diskSpace: { status: "UP", total: 290391584768, free: 209372835840, threshold: 10485760 } }
As you can see, the preceding information is about the health of your Spring application. Along with the basic health status, you're also given information regarding the amount of available disk space and the status of the database that the application is using.
Let's see how to expose application information by using /info endpoints.
推薦閱讀
- 辦公軟件高級應(yīng)用實用教程
- Hands-On G Suite for Administrators
- 天天用的Office一百招
- 金蝶KIS:財務(wù)軟件培訓(xùn)教程(第2版)
- Word Excel PPT 三合一 效率手冊:早做完,不加班
- 跟李銳學(xué)Excel數(shù)據(jù)分析
- 高效隨身查:PPT2021必學(xué)的美化設(shè)計應(yīng)用技巧(視頻教學(xué)版)
- Excel+PPT+Word+PS+短視頻剪輯+PDF+思維導(dǎo)圖+居家辦公+辦公設(shè)備9合1
- PPT多媒體課件制作從新手到高手
- Office辦公應(yīng)用技巧
- Excel 2007表格·數(shù)據(jù)·圖表完全自學(xué)手冊
- Hands-On Kubernetes on Azure
- AI智能化辦公:ChatGPT使用方法與技巧從入門到精通
- 數(shù)據(jù)分析:企業(yè)的賢內(nèi)助
- Excel效率手冊:早做完,不加班(升級版)