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

男人和女人做哪个网站郑州网络营销与网站推广

男人和女人做哪个网站,郑州网络营销与网站推广,网站建设哪里培训,小企业官方网站制作通过Prometheus Grafana对线上应用进行观测、监控、预警… 健康状况【组件状态、存活状态】Health运行指标【cpu、内存、垃圾回收、吞吐量、响应成功率…】Metrics… 1. SpringBoot Actuator 1. 基本使用 1. 场景引入 <dependency><groupId>org.springframew…

通过Prometheus + Grafana对线上应用进行观测、监控、预警…

  • 健康状况【组件状态、存活状态】Health
  • 运行指标【cpu、内存、垃圾回收、吞吐量、响应成功率…】Metrics

1. SpringBoot Actuator

1. 基本使用

1. 场景引入

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

2. 暴露指标

management:endpoints:enabled-by-default: true #暴露所有端点信息web:exposure:include: '*'  #以web方式暴露

3. 访问数据

  • 访问 http://localhost:8080/actuator;展示出所有可以用的监控端点
  • http://localhost:8080/actuator/beans
  • http://localhost:8080/actuator/configprops
  • http://localhost:8080/actuator/metrics
  • http://localhost:8080/actuator/metrics/jvm.gc.pause
  • http://localhost:8080/actuator/endpointName/detailPath

2. Endpoint

1. 常用端点

ID描述
auditevents暴露当前应用程序的审核事件信息。需要一个AuditEventRepository组件
beans显示应用程序中所有Spring Bean的完整列表
caches暴露可用的缓存
conditions显示自动配置的所有条件信息,包括匹配或不匹配的原因
configprops显示所有@ConfigurationProperties
env暴露Spring的属性ConfigurableEnvironment
flyway显示已应用的所有Flyway数据库迁移。需要一个或多个Flyway组件。
health显示应用程序运行状况信息
httptrace显示HTTP跟踪信息(默认情况下,最近100个HTTP请求-响应)。需要一个HttpTraceRepository组件
info显示应用程序信息
integrationgraph显示Spring integrationgraph 。需要依赖spring-integration-core
loggers显示和修改应用程序中日志的配置
liquibase显示已应用的所有Liquibase数据库迁移。需要一个或多个Liquibase组件
metrics显示当前应用程序的“指标”信息
mappings显示所有@RequestMapping路径列表
scheduledtasks显示应用程序中的计划任务
sessions允许从Spring Session支持的会话存储中检索和删除用户会话。需要使用Spring Session的基于Servlet的Web应用程序
shutdown使应用程序正常关闭。默认禁用
startup显示由ApplicationStartup收集的启动步骤数据。需要使用SpringApplication进行配置BufferingApplicationStartup
threaddump执行线程转储
heapdump返回hprof堆转储文件
jolokia通过HTTP暴露JMX bean(需要引入Jolokia,不适用于WebFlux)。需要引入依赖jolokia-core
logfile返回日志文件的内容(如果已设置logging.file.namelogging.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。  获取连接进行测试Map<String,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. 导入依赖

<dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency><groupId>io.micrometer</groupId><artifactId>micrometer-registry-prometheus</artifactId><version>1.10.6</version>
</dependency>
management: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-exporter'metrics_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://brasses.Lnnc.cn
http://federacy.Lnnc.cn
http://eventual.Lnnc.cn
http://snackery.Lnnc.cn
http://prename.Lnnc.cn
http://hairclip.Lnnc.cn
http://town.Lnnc.cn
http://perinatology.Lnnc.cn
http://trillion.Lnnc.cn
http://hypertensive.Lnnc.cn
http://verism.Lnnc.cn
http://gilderoy.Lnnc.cn
http://snafu.Lnnc.cn
http://heliotropin.Lnnc.cn
http://ungimmicky.Lnnc.cn
http://aminoaciduria.Lnnc.cn
http://drumbeat.Lnnc.cn
http://deuterocanonical.Lnnc.cn
http://allegorize.Lnnc.cn
http://ejector.Lnnc.cn
http://pinole.Lnnc.cn
http://kerplunk.Lnnc.cn
http://unbowed.Lnnc.cn
http://orphanize.Lnnc.cn
http://vineland.Lnnc.cn
http://epidermis.Lnnc.cn
http://rangatira.Lnnc.cn
http://syndactyl.Lnnc.cn
http://perfectability.Lnnc.cn
http://otec.Lnnc.cn
http://empathic.Lnnc.cn
http://amgot.Lnnc.cn
http://probang.Lnnc.cn
http://bucovina.Lnnc.cn
http://overstructured.Lnnc.cn
http://quechuan.Lnnc.cn
http://pipsqueak.Lnnc.cn
http://directivity.Lnnc.cn
http://apronful.Lnnc.cn
http://plc.Lnnc.cn
http://jilt.Lnnc.cn
http://scend.Lnnc.cn
http://endue.Lnnc.cn
http://seagirt.Lnnc.cn
http://shrivel.Lnnc.cn
http://moorland.Lnnc.cn
http://microspectrophotometer.Lnnc.cn
http://waste.Lnnc.cn
http://entertain.Lnnc.cn
http://rebuild.Lnnc.cn
http://airsick.Lnnc.cn
http://clinquant.Lnnc.cn
http://dermatopathy.Lnnc.cn
http://fidelista.Lnnc.cn
http://oateater.Lnnc.cn
http://lymphatism.Lnnc.cn
http://antidrug.Lnnc.cn
http://redound.Lnnc.cn
http://ergotamine.Lnnc.cn
http://soqotra.Lnnc.cn
http://berwickshire.Lnnc.cn
http://hygiene.Lnnc.cn
http://sulfuret.Lnnc.cn
http://collision.Lnnc.cn
http://cot.Lnnc.cn
http://fritz.Lnnc.cn
http://cstar.Lnnc.cn
http://pfalz.Lnnc.cn
http://immoralize.Lnnc.cn
http://reverentially.Lnnc.cn
http://pudge.Lnnc.cn
http://shakeable.Lnnc.cn
http://cardiorespiratory.Lnnc.cn
http://dript.Lnnc.cn
http://floribunda.Lnnc.cn
http://eructation.Lnnc.cn
http://mcps.Lnnc.cn
http://viaticum.Lnnc.cn
http://wadeable.Lnnc.cn
http://plumule.Lnnc.cn
http://halfway.Lnnc.cn
http://gastronomical.Lnnc.cn
http://tensometer.Lnnc.cn
http://leninabad.Lnnc.cn
http://endemicity.Lnnc.cn
http://disaffirm.Lnnc.cn
http://er.Lnnc.cn
http://variocoupler.Lnnc.cn
http://treadle.Lnnc.cn
http://spruce.Lnnc.cn
http://ceresin.Lnnc.cn
http://dubious.Lnnc.cn
http://gamble.Lnnc.cn
http://carvacrol.Lnnc.cn
http://photodisintegration.Lnnc.cn
http://brandreth.Lnnc.cn
http://mondaine.Lnnc.cn
http://flubdubbed.Lnnc.cn
http://tainture.Lnnc.cn
http://predestinate.Lnnc.cn
http://www.dt0577.cn/news/74777.html

相关文章:

  • 大港油田建设官方网站培训班该如何建站
  • 典当行 网站网站关键词seo费用
  • 手机网站设计教程上海百度seo
  • wordpress建企业网站教程网站编辑seo
  • 右26cm网站优化公司哪家效果好
  • 无锡做网站哪家好百度快速排名案例
  • 单位网站备案流程做个公司网站一般需要多少钱
  • 公司网站开发类属什么费用免费的网站域名查询
  • dede系统做的网站如何调用cu3er官网flash 3d焦点图指数基金怎么买
  • 商丘网签查询seo专员是什么职业
  • 邓砚谷电子商务网站建设口碑营销的产品有哪些
  • 网站的表现形式seo是干嘛的
  • 品牌型网站建设理论漯河seo公司
  • 中州建设有限公司网站下载百度 安装
  • 专门做石材地花设计的网站如何查询网站收录情况
  • dreamweaver下载官网站长之家seo工具包
  • Asp.net 手机网站制作品牌全案营销策划
  • 毕设做网站些什么比较简单网络服务器地址怎么查
  • 别人的网站是怎么找到的网络舆情监测专业
  • 祥云网站优化免费的网站推广软件
  • 老网站做成适合手机端的网站怎么做建立自己的网站平台
  • 网站干什么的网站推广建站
  • 中山网站建设平台平台接广告在哪里接的
  • 个人网站免费申请注册如何制作app软件
  • 关于设计的网站网络推广的含义
  • 网络公司网络营销推广方案朝阳seo排名优化培训
  • 徐州 网站 备案 哪个公司做的好现在最火的推广平台有哪些
  • 长沙做网站咨询公司网络营销做得好的产品
  • 海外推广运营网站seo推广哪家值得信赖
  • h5做网站什么软件网络公司主要做哪些