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

律师事务所公司类网站建设案例阿里巴巴运营流程

律师事务所公司类网站建设案例,阿里巴巴运营流程,南昌网站设计有限公司,重庆电子商务网站通过Prometheus Grafana对线上应用进行观测、监控、预警… 健康状况【组件状态、存活状态】Health运行指标【cpu、内存、垃圾回收、吞吐量、响应成功率…】Metrics… 1. SpringBoot Actuator 1. 基本使用 1. 场景引入 dependencygroupIdorg.springframew…通过Prometheus Grafana对线上应用进行观测、监控、预警… 健康状况【组件状态、存活状态】Health运行指标【cpu、内存、垃圾回收、吞吐量、响应成功率…】Metrics… 1. SpringBoot Actuator 1. 基本使用 1. 场景引入 dependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-actuator/artifactId /dependency2. 暴露指标 management:endpoints:enabled-by-default: true #暴露所有端点信息web:exposure:include: * #以web方式暴露3. 访问数据 访问 http://localhost:8080/actuator展示出所有可以用的监控端点http://localhost:8080/actuator/beanshttp://localhost:8080/actuator/configpropshttp://localhost:8080/actuator/metricshttp://localhost:8080/actuator/metrics/jvm.gc.pausehttp://localhost:8080/actuator/endpointName/detailPath 2. Endpoint 1. 常用端点 ID描述auditevents暴露当前应用程序的审核事件信息。需要一个AuditEventRepository组件beans显示应用程序中所有Spring Bean的完整列表caches暴露可用的缓存conditions显示自动配置的所有条件信息包括匹配或不匹配的原因configprops显示所有ConfigurationPropertiesenv暴露Spring的属性ConfigurableEnvironmentflyway显示已应用的所有Flyway数据库迁移。需要一个或多个Flyway组件。health显示应用程序运行状况信息httptrace显示HTTP跟踪信息默认情况下最近100个HTTP请求-响应。需要一个HttpTraceRepository组件info显示应用程序信息integrationgraph显示Spring integrationgraph 。需要依赖spring-integration-coreloggers显示和修改应用程序中日志的配置liquibase显示已应用的所有Liquibase数据库迁移。需要一个或多个Liquibase组件metrics显示当前应用程序的“指标”信息mappings显示所有RequestMapping路径列表scheduledtasks显示应用程序中的计划任务sessions允许从Spring Session支持的会话存储中检索和删除用户会话。需要使用Spring Session的基于Servlet的Web应用程序shutdown使应用程序正常关闭。默认禁用startup显示由ApplicationStartup收集的启动步骤数据。需要使用SpringApplication进行配置BufferingApplicationStartupthreaddump执行线程转储heapdump返回hprof堆转储文件jolokia通过HTTP暴露JMX bean需要引入Jolokia不适用于WebFlux。需要引入依赖jolokia-corelogfile返回日志文件的内容如果已设置logging.file.name或logging.file.path属性。支持使用HTTP Range标头来检索部分日志文件的内容prometheus以Prometheus服务器可以抓取的格式公开指标。需要依赖micrometer-registry-prometheus 2. 定制端点 健康监控返回存活、死亡指标监控次数、率 1. HealthEndpoint import org.springframework.boot.actuate.health.Health; import org.springframework.boot.actuate.health.HealthIndicator; import org.springframework.stereotype.Component;Component public class MyHealthIndicator implements HealthIndicator {Overridepublic Health health() {int errorCode check(); // perform some specific health checkif (errorCode ! 0) {return Health.down().withDetail(Error Code, errorCode).build();}return Health.up().build();}}构建Health Health build Health.down().withDetail(msg, error service).withDetail(code, 500).withException(new RuntimeException()).build();management:health:enabled: trueshow-details: always #总是显示详细信息。可显示每个模块的状态信息Component public class MyComHealthIndicator extends AbstractHealthIndicator {/*** 真实的检查方法* param builder* throws Exception*/Overrideprotected void doHealthCheck(Health.Builder builder) throws Exception {//mongodb。 获取连接进行测试MapString,Object map new HashMap();// 检查完成if(1 2){ // builder.up(); //健康builder.status(Status.UP);map.put(count,1);map.put(ms,100);}else { // builder.down();builder.status(Status.OUT_OF_SERVICE);map.put(err,连接超时);map.put(ms,3000);}builder.withDetail(code,100).withDetails(map);} }2. MetricsEndpoint class MyService{Counter counter;//默认一个构造时参数会从ioc中拿public MyService(MeterRegistry meterRegistry){counter meterRegistry.counter(myservice.method.running.counter);}public void hello() {counter.increment();} }2. 监控落地 基于 Prometheus Grafana 1. 安装 Prometheus Grafana 安装 Prometheus Grafana 2. 导入依赖 dependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-actuator/artifactId /dependency dependencygroupIdio.micrometer/groupIdartifactIdmicrometer-registry-prometheus/artifactIdversion1.10.6/version /dependencymanagement:endpoints:web:exposure: #暴露所有监控的端点include: *访问 http://localhost:8001/actuator/prometheus 验证返回 prometheus 格式的所有指标 部署Java应用到服务器 确保可以访问到部署好的服务http://192.168.254.129:8080/actuator/prometheus http://192.168.254.129:8080/actuator 3. 配置 Prometheus 拉取数据 ## 修改 prometheus.yml 配置文件 scrape_configs:- job_name: spring-boot-actuator-exportermetrics_path: /actuator/prometheus #指定抓取的路径static_configs:- targets: [192.168.254.129:8080]labels:nodename: app-demo配置完记得重启容器 4. 配置 Grafana 监控面板 添加数据源Prometheus 添加面板。可去 grafana dashboard 市场找一个自己喜欢的面板也可以自己开发面板 市场直接搜索springboot注意看面板支持的数据源复制面板ID 填入面板id选择刚刚创建好的数据源 5. 效果 等待应用运行一会后就会显示出对应的监控数据
http://www.yutouwan.com/news/305636/

相关文章:

  • 怎么做视频网站教程iis 设置网站权限
  • wordpress 英文 企业网站模板网站域名备案需要多长时间
  • 网站信息资源建设国外最具创意的wordpress博客
  • 个人网站流程响应式网站怎么做才实用
  • 建立网站的软件下载wordpress文章代码插件
  • 吉林手机版建站系统开发网站 设计理念
  • 长春做网站设计装潢设计与工艺教育专业
  • 丹徒网站2013电子商务网站建设
  • 和平县做网站手机网站欣赏
  • 协会网站信息平台建设梧州论坛看点
  • 网站建设的基本需求有哪些方面建设机械网站制作
  • 网站后台尺寸一般做多大的免费承接网站建设
  • 雅安建设网站浦口区建设中学网站
  • 绿色大气漂亮dedecms茶叶企业网站进行网站建设
  • 网站建设中的需求报告功能wordpress七牛云加速
  • 湖南网站设计制作网站关键词怎么优化排名
  • 哪个网站是营销型网站汽车网有哪些网站大全
  • 客户网站建设洽谈方案谷歌seo查询
  • 昆明 网站建设兼职网站建设与管理是哪个软件
  • 上海模板建站公司应届生在淮北招的网站建设类型岗位
  • 深圳 SEO 网站建设 哪里学大连网站开发培训
  • 新公司需要做网站wordpress前端文章编辑器
  • 网站建设栏目说明百度一下首页登录
  • 江西专业的网站建设公司免费建设公司网站
  • 百度网盘网站开发文档模板怎么做网站填内容
  • 租空间做网站需要多少钱wordpress 获取评论id
  • 招商加盟网站模板程序企业宣传片视频制作公司
  • 移动互联网网站开发技术深圳建设外贸网站
  • 影视网站搭建平台南昌县城乡规划建设局官方网站
  • 自己建网站怎么推广网站建设阶段要做什么