spring boot 通過actuator 來提供應(yīng)用服務(wù)器信息。例如可以通過health 查看存儲信息,服務(wù)器是否正常運行 通過metrics可以觀察heap, mem等信息。 方便用戶監(jiān)控應(yīng)用
固原ssl適用于網(wǎng)站、小程序/APP、API接口等需要進(jìn)行數(shù)據(jù)傳輸應(yīng)用場景,ssl證書未來市場廣闊!成為創(chuàng)新互聯(lián)的ssl證書銷售渠道,可以享受市場價格4-6折優(yōu)惠!如果有意向歡迎電話聯(lián)系或者加微信:13518219792(備注:SSL證書合作)期待與您的合作!1 在pom.xml 添加actuator 依賴
org.springframework.boot spring-boot-starter-actuator
2 在application.properties 配置詳細(xì)信息
management.context-path=/manage endpoints.health.sensitive=false endpoints.metrics.sensitive=false endpoints.info.sensitive=false management.context-path=/manage endpoints.health.sensitive=false endpoints.metrics.sensitive=false endpoints.info.sensitive=false #config info details info.app.name=MyApp info.app.description=descript for the project info.build.groupId=@project.groupId@ info.build.artiface=@project.artifactId@ info.build.version=@project.version@ info.app.encoding=@project.build.sourceEncoding@ info.app.java.source=@java.version@ info.app.java.target=@java.version@
3 測試這里我配置了/manage 為actuator的根路徑
輸入localhost:8080/manage/health
{"status":"UP","diskSpace":{"status":"UP","total":255534821376,"free":107373064192,"threshold":10485760},"db":{"status":"UP","database":"Oracle","hello":"Hello"}}
輸入localhost:8080/manage/metrics
{"mem":374672,"mem.free":112188,"processors":4,"instance.uptime":182778,"uptime":199229,"systemload.average":-1.0,"heap.committed":310272,"heap.init":253952,"heap.used":198083,"heap":3592192,"nonheap.committed":66176,"nonheap.init":2496,"nonheap.used":64401,"nonheap":0,"threads.peak":33,"threads.daemon":31,"threads.totalStarted":40,"threads":33,"classes":7965,"classes.loaded":7967,"classes.unloaded":2,"gc.ps_scavenge.count":12,"gc.ps_scavenge.time":233,"gc.ps_marksweep.count":2,"gc.ps_marksweep.time":139,"httpsessions.max":-1,"httpsessions.active":0,"gauge.response.star-star":12.0,"gauge.response.manage.health":935.0,"counter.status.404.star-star":2,"counter.status.200.manage.health":1}
創(chuàng)新互聯(lián)www.cdcxhl.cn,專業(yè)提供香港、美國云服務(wù)器,動態(tài)BGP最優(yōu)骨干路由自動選擇,持續(xù)穩(wěn)定高效的網(wǎng)絡(luò)助力業(yè)務(wù)部署。公司持有工信部辦法的idc、isp許可證, 機(jī)房獨有T級流量清洗系統(tǒng)配攻擊溯源,準(zhǔn)確進(jìn)行流量調(diào)度,確保服務(wù)器高可用性。佳節(jié)活動現(xiàn)已開啟,新人活動云服務(wù)器買多久送多久。