浅析springcloud 整合 zipkin-server 内存日志监控
Zipkin
Zipkin是一款开源的分布式实时数据追踪系统(DistributedTrackingSystem),基于GoogleDapper的论文设计而来,由Twitter公司开发贡献。其主要功能是聚集来自各个异构系统的实时监控数据。
Zipkin主要包括四个模块
- Collector 接收或收集各应用传输的数据
- Storage 存储接受或收集过来的数据,当前支持Memory,MySQL,Cassandra,ElasticSearch等,默认存储在内存中。
- API(Query) 负责查询Storage中存储的数据,提供简单的JSONAPI获取数据,主要提供给webUI使用
- Web 提供简单的web界面
下面通过代码给大家介绍springcloud整合zipkin-server内存日志监控问题,具体内容如下所示:
1. pom.xml加入
io.zipkin.java zipkin-server 2.12.3 org.apache.logging.log4j log4j-slf4j-impl io.zipkin.java zipkin-autoconfigure-ui 2.12.3 io.zipkin.java zipkin-autoconfigure-collector-kafka 2.12.9 io.zipkin.java zipkin-autoconfigure-storage-elasticsearch-http 2.8.4
2.application.properties配置文件
spring.application.name=fhcloud-zipkin-server server.port=8003 #开启安全认证用户名和密码 spring.security.basic.enabled=true spring.security.user.name=admin spring.security.user.password=root #指向注册中心 eureka.instance.leaseRenewalIntervalInSeconds=10 eureka.client.registryFetchIntervalSeconds=5 eureka.client.serviceUrl.defaultZone=http://127.0.0.1:8761/eureka/,http://127.0.0.1:8762/eureka/ #actuator配置 management.endpoints.web.exposure.include=* management.endpoints.web.exposure.exclude=env,beans management.security.enabled=false management.metrics.web.server.auto-time-requests=fals
3.启动类FHmainApplication.java
packageorg.fh; importorg.springframework.boot.SpringApplication; importorg.springframework.boot.autoconfigure.SpringBootApplication; importorg.springframework.cloud.netflix.eureka.EnableEurekaClient; importzipkin2.server.internal.EnableZipkinServer; /** *说明:启动类 *www.1b23.com */ @SpringBootApplication @EnableEurekaClient @EnableZipkinServer publicclassFHmainApplication{ publicstaticvoidmain(String[]args){ SpringApplication.run(FHmainApplication.class,args); } }
总结
以上所述是小编给大家介绍的springcloud整合zipkin-server内存日志监控,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对毛票票网站的支持!
如果你觉得本文对你有帮助,欢迎转载,烦请注明出处,谢谢!
声明:本文内容来源于网络,版权归原作者所有,内容由互联网用户自发贡献自行上传,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任。如果您发现有涉嫌版权的内容,欢迎发送邮件至:czq8825#qq.com(发邮件时,请将#更换为@)进行举报,并提供相关证据,一经查实,本站将立刻删除涉嫌侵权内容。