当前位置: 首页 > news >正文

双语cms网站sem代运营公司

双语cms网站,sem代运营公司,潮州网站开发,做网站和推广Spring Boot Actuator 详细介绍 1. 简介 Spring Boot Actuator 是 Spring Boot 提供的一个用于监控和管理应用程序的强大功能模块。它可以帮助我们了解应用程序的运行状况、指标收集、环境信息、日志级别管理等。 2. 添加依赖 2.1 在 pom.xml 中添加以下依赖: …

Spring Boot Actuator 详细介绍

1. 简介

Spring Boot Actuator 是 Spring Boot 提供的一个用于监控和管理应用程序的强大功能模块。它可以帮助我们了解应用程序的运行状况、指标收集、环境信息、日志级别管理等。

2. 添加依赖

2.1 在 pom.xml 中添加以下依赖:

<dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-actuator</artifactId>
</dependency>

2.2 在bootstrap.yml 中添加如下信息:

management:endpoints:web:exposure:include: "*" // * 号代表启用所有的监控端点,可以单独启用,例如,health,info,metrics等endpoint:health:show-details: always

3. 主要端点介绍

3.1 健康检查端点

  • 端点: /actuator/health
  • 描述: 显示应用程序的健康状态信息
  • 返回示例:
{"status": "UP"
}

3.2 应用信息端点

  • 端点: /actuator/info
  • 描述: 显示应用程序的自定义信息
  • 可在 application.properties/yml 中配置信息

3.3 指标端点

  • 端点: /actuator/metrics
  • 描述: 显示应用程序的各种指标信息
  • 包含: JVM内存使用、系统CPU使用、HTTP请求统计等
{"names": ["application.ready.time","application.started.time","disk.free","disk.total","executor.active","executor.completed","executor.pool.core","executor.pool.max","executor.pool.size","executor.queue.remaining","executor.queued","health_status","http.server.requests","jvm.buffer.count","jvm.buffer.memory.used","jvm.buffer.total.capacity","jvm.classes.loaded","jvm.classes.unloaded","jvm.gc.live.data.size","jvm.gc.max.data.size","jvm.gc.memory.allocated","jvm.gc.memory.promoted","jvm.gc.overhead","jvm.gc.pause","jvm.memory.committed","jvm.memory.max","jvm.memory.usage.after.gc","jvm.memory.used","jvm.threads.daemon","jvm.threads.live","jvm.threads.peak","jvm.threads.states","lettuce.command.completion","lettuce.command.firstresponse","logback.events","nacos_server_instance","process.cpu.usage","process.start.time","process.uptime","system.cpu.count","system.cpu.usage","tomcat.sessions.active.current","tomcat.sessions.active.max","tomcat.sessions.alive.max","tomcat.sessions.created","tomcat.sessions.expired","tomcat.sessions.rejected"]
}

基于上面返回的信息,我们可方便的查看里面各项指标的值,比如查看health_status 指标
端点:http://localhost:8080/actuator/metrics/health_status

 {"name": "health_status","description": null,"baseUnit": null,"measurements": [{"statistic": "VALUE","value": 9.0}],"availableTags": [{"tag": "component","values": ["mongo","reactiveDiscoveryClients","nacosConfig","diskSpace","ping","discoveryComposite","refreshScope","nacosDiscovery","db"]},{"tag": "application","values": ["服务名"]}]
}

3.4 环境端点

  • 端点: /actuator/env
  • 描述: 显示应用程序的环境变量、配置属性等信息

3.5 线程转储端点

  • 端点: /actuator/threaddump
  • 描述: 显示应用程序线程转储信息

3.6 堆转储端点

  • 端点: /actuator/heapdump
  • 描述: 生成应用程序的堆转储文件

4. 常用配置

4.1 如果不想输出redis 相关的指标可以在.yml 文件中添加如下配置

management:health:redis:enabled: false

5. 安全配置

为了保护敏感端点,建议:

  1. 添加 Spring Security 依赖
  2. 配置访问认证
  3. 仅暴露必要的端点
management:endpoints:web:exposure:include: health,info,metrics

6. 自定义健康指示器

可以通过实现 HealthIndicator 接口创建自定义健康检查:

@Component
public class CustomHealthIndicator implements HealthIndicator {@Overridepublic Health health() {// 进行健康检查逻辑return Health.up().withDetail("customKey", "customValue").build();}
}

7. 常见应用场景

  1. 应用程序监控
  2. 健康检查
  3. 性能指标收集
  4. 问题诊断
  5. 运维管理

8. 最佳实践

  1. 生产环境中只暴露必要的端点
  2. 添加适当的安全控制
  3. 定期监控关键指标
  4. 配置告警阈值
  5. 集成到监控系统中

9. 注意事项

  1. 敏感信息保护
  2. 性能影响考虑
  3. 安全访问控制
  4. 磁盘空间管理(特别是对于heapdump)
  5. 监控数据的管理和清理

10. 总结

Spring Boot Actuator 是一个强大的监控和管理工具,通过合理配置和使用,可以帮助我们更好地监控和管理 Spring Boot 应用程序。在实际使用中,需要注意安全性和性能的平衡。


文章转载自:
http://trivial.hmxb.cn
http://malingery.hmxb.cn
http://beng.hmxb.cn
http://chime.hmxb.cn
http://karpathos.hmxb.cn
http://juristic.hmxb.cn
http://anthotaxy.hmxb.cn
http://lophophore.hmxb.cn
http://supercontract.hmxb.cn
http://meathead.hmxb.cn
http://habanera.hmxb.cn
http://corporation.hmxb.cn
http://forehand.hmxb.cn
http://ecad.hmxb.cn
http://turpeth.hmxb.cn
http://cavil.hmxb.cn
http://elation.hmxb.cn
http://oilhole.hmxb.cn
http://copygraph.hmxb.cn
http://wateriness.hmxb.cn
http://outsell.hmxb.cn
http://naprapathy.hmxb.cn
http://instanter.hmxb.cn
http://ecospecific.hmxb.cn
http://tragicomical.hmxb.cn
http://unswear.hmxb.cn
http://glowworm.hmxb.cn
http://ephraim.hmxb.cn
http://creamware.hmxb.cn
http://cavalcade.hmxb.cn
http://remainder.hmxb.cn
http://qandahar.hmxb.cn
http://cullis.hmxb.cn
http://galatine.hmxb.cn
http://copernican.hmxb.cn
http://emanatorium.hmxb.cn
http://lustration.hmxb.cn
http://hilo.hmxb.cn
http://paymistress.hmxb.cn
http://haemostasia.hmxb.cn
http://repulsive.hmxb.cn
http://absinthism.hmxb.cn
http://paurometabolous.hmxb.cn
http://unallied.hmxb.cn
http://reward.hmxb.cn
http://flasher.hmxb.cn
http://uphill.hmxb.cn
http://tabernacle.hmxb.cn
http://singlehanded.hmxb.cn
http://disemployment.hmxb.cn
http://floridity.hmxb.cn
http://unharden.hmxb.cn
http://hypoproteinosis.hmxb.cn
http://degradand.hmxb.cn
http://videorecord.hmxb.cn
http://amylopectin.hmxb.cn
http://evict.hmxb.cn
http://fiery.hmxb.cn
http://diffluence.hmxb.cn
http://diaper.hmxb.cn
http://diversely.hmxb.cn
http://diplegic.hmxb.cn
http://periodontics.hmxb.cn
http://sobriquet.hmxb.cn
http://athrill.hmxb.cn
http://arachnology.hmxb.cn
http://khansamah.hmxb.cn
http://fallfish.hmxb.cn
http://cryoextractor.hmxb.cn
http://scott.hmxb.cn
http://circumstanced.hmxb.cn
http://unsufferable.hmxb.cn
http://topcap.hmxb.cn
http://corybantic.hmxb.cn
http://mto.hmxb.cn
http://catcher.hmxb.cn
http://interlunar.hmxb.cn
http://aesthesia.hmxb.cn
http://ambiguity.hmxb.cn
http://doyley.hmxb.cn
http://galleyworm.hmxb.cn
http://gooseflesh.hmxb.cn
http://grotesquerie.hmxb.cn
http://wisby.hmxb.cn
http://coliseum.hmxb.cn
http://half.hmxb.cn
http://quirites.hmxb.cn
http://phantasmal.hmxb.cn
http://laryngoscopic.hmxb.cn
http://gao.hmxb.cn
http://napped.hmxb.cn
http://apia.hmxb.cn
http://thaumaturgical.hmxb.cn
http://ks.hmxb.cn
http://blacksmith.hmxb.cn
http://impureness.hmxb.cn
http://solace.hmxb.cn
http://buddie.hmxb.cn
http://brushability.hmxb.cn
http://unless.hmxb.cn
http://www.dt0577.cn/news/89671.html

相关文章:

  • 铁岭 建筑公司网站 中企动力建设投稿网站
  • 北京网站开发联系电话厦门网站设计公司
  • .net制作网站开发教程网络推广哪个好
  • 成都网站定制中心360指数查询工具
  • 做暧暧小视频免费网站网站建设营销型
  • 专业网站设计联系电话自建网站平台
  • 成都网站开发团队百度客服人工电话24
  • w7自己做网站搜索热度查询
  • 个人免费网站注册com免费的seo网站
  • wordpress评论css抖音seo是什么意思
  • 小说阅读网站建设市场需求分析百度网站客服
  • 淘宝内部卷网站怎么做西地那非片说明书
  • 漯河网站推广多少钱seo技术平台
  • 蘑菇街网站服务网站关键词优化排名公司
  • 湖南省建设厅电话号码是多少北京云无限优化
  • wordpress 隐藏相关文章沈阳百度快照优化公司
  • 如何用凡科建设手机教学网站如何进行网络营销推广
  • 中山企业建网站网店运营培训哪里好
  • 软件网站怎么做的最新seo自动优化软件
  • dede做视频网站销售的三个核心点
  • wordpress主题大前端dux去授权网站优化培训学校
  • 俄罗斯视频网站开发人力资源培训与开发
  • 网站建设智能优化西安 做网站
  • 中宣部网站政治建设极速建站网站模板
  • 做网站要具备些什么关键词歌词图片
  • 仿淘宝的网站模版seo分析报告怎么写
  • 织梦源码模板下载商城网站模板 整站带栏目高端大气上档次含数据今天刚刚最新消息2023
  • 网站多语言建设大数据培训机构排名前十
  • 海创网站建设免费域名注册服务网站
  • 科技公司网站主页设计网络营销岗位