zipkin服务器端

1、依赖

<!-- zipkin server -->
<dependency>
<groupId>io.zipkin.java</groupId>
<artifactId>zipkin-autoconfigure-ui</artifactId>
</dependency>
<dependency>
<groupId>io.zipkin.java</groupId>
<artifactId>zipkin-server</artifactId>
</dependency> <!-- kafka -->
<dependency>
<groupId>io.zipkin.java</groupId>
<artifactId>zipkin-autoconfigure-collector-kafka</artifactId>
<version>2.4.1</version>
</dependency>

2、启动类上添加@EnableZipkinServer

3、配置文件

#存储类型,缺失配置项的时候默认使用内存
zipkin.storage.type=mem
zipkin.collector.kafka.bootstrap-servers=10.1.8.2:9192
zipkin.collector.kafka.zookeeper=10.1.8.2:2282/kafka210dev
#kafka主题,不配置时默认使用zipkin
zipkin.collector.kafka.topic=zipkin

微服务端

1、依赖

<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-zipkin</artifactId>
</dependency> <dependency>
<groupId>org.springframework.kafka</groupId>
<artifactId>spring-kafka</artifactId>
</dependency>

2、配置

#配置zipkin发送类型为kafka
spring.zipkin.sender.type=kafka
spring.kafka.bootstrap-servers=10.1.8.2:9192
#kafka主题,不配置时默认使用zipkin
spring.zipkin.kafka.topic=zipkin
#设置服务名,不设置默认使用spring.application.name
spring.zipkin.service.name=gateway
#采样率设置
spring.sleuth.sampler.percentage=1.0

创建Kafka主题

进入kafka的bin目录,创建zipkin主题。

kafka-topics.sh --create --zookeeper 10.1.8.2:2282/kafka210dev --replication-factor 1 --partitions 1 --topic zipkin

监视kafka中的数据

kafka-console-consumer.sh --bootstrap-server 10.1.8.2:9192 --topic zipkin

参考周立大神博文:http://www.itmuch.com/spring-cloud/edgware-new-sleuth-zipkin-mq/

Spring Cloud Edgware之后版本 Zipkin+Kafka整合的更多相关文章

  1. spring cloud:Edgware.RELEASE版本hystrix超时新坑

    升级到Edgware.RELEASE发现,zuul中不管如何设置hystrix的超时时间均不起作用,仍然是默认的1000ms.  降回低版本后正常,但是低版本的fallback方法中,又拿不到详细异常 ...

  2. spring cloud:Edgware.RELEASE版本中zuul回退方法的变化

    Edgware.RELEASE以前的版本中,zuul网关中有一个ZuulFallbackProvider接口,代码如下: public interface ZuulFallbackProvider { ...

  3. spring cloud 2.x版本 Sleuth+Zipkin分布式链路追踪

    前言 本文采用Spring cloud本文为2.1.8RELEASE,version=Greenwich.SR3 本文基于前两篇文章eureka-server.eureka-client.eureka ...

  4. spring cloud 2.x版本 Spring Cloud Stream消息驱动组件基础教程(kafaka篇)

    本文采用Spring cloud本文为2.1.8RELEASE,version=Greenwich.SR3 本文基于前两篇文章eureka-server.eureka-client.eureka-ri ...

  5. Spring Cloud简介以及版本选择

    什么是SpringCloud 官方的说法就是spring Cloud 给开发者提供一套按照一定套路快速开发 分布式系统 的工具. 具体点就是Spring boot实现的微服务架构开发工具.它为微服务架 ...

  6. 史上最简单的SpringCloud教程 | 第九篇: 服务链路追踪(Spring Cloud Sleuth)(Finchley版本)

    转载请标明出处: 原文首发于:>https://www.fangzhipeng.com/springcloud/2018/08/30/sc-f9-sleuth/ 本文出自方志朋的博客 这篇文章主 ...

  7. spring cloud 2.x版本 Gateway路由网关教程

    前言 本文采用Spring cloud本文为2.1.8RELEASE,version=Greenwich.SR3 本文基于前两篇文章eureka-server.eureka-client.eureka ...

  8. Spring Cloud Edgware Release Notes

    Spring Cloud Edgware builds on Spring Boot 1.5.x. Renamed starters A number of starters did not foll ...

  9. spring cloud 2.x版本 Ribbon服务发现教程(内含集成Hystrix熔断机制)

    本文采用Spring cloud本文为2.1.8RELEASE,version=Greenwich.SR3 前言 本文基于前两篇文章eureka-server和eureka-client的实现. 参考 ...

随机推荐

  1. Django框架之跨站请求伪造

    跨站请求伪造(英语:Cross-site request forgery),也被称为one-click attack或者session riding,通常缩写为CSRF或者XSRF, 是一种挟制用户在 ...

  2. leetcode 136 Single Number, 260 Single Number III

    leetcode 136. Single Number Given an array of integers, every element appears twice except for one. ...

  3. WordPress REST API 内容注入漏洞

    1 WordPress REST API 内容注入漏洞 1.1 摘要 1.1.1 漏洞介绍 WordPress是一个以PHP和MySQL为平台的自由开源的博客软件和内容管理系统.在4.7.0版本后,R ...

  4. Cocoa 初识

    1,判断程序是否第一次启动 OC: if (![[NSUserDefaults stringOfKeyInStandardDefaults:FirstOpenApp] boolValue]) { [s ...

  5. 【问题解决】An internal error occurred during: "Computing additional info". Could not initialize class javax.crypto.JceSecurityManager

    在使用eclipse时对象后使用点操作符时总是会弹出错误,很是烦人 An internal error occurred during: "Computing additional info ...

  6. C# Byte[] 数组操作

    byte[] Strbyte = Encoding.GetEncoding("big5").GetBytes(str);            if (Strbyte.Length ...

  7. nginx配置二级域名

    我在我的服务器上面跑了两个node应用程序,分别一个端口2368跑的是ghost博客,一个端口8000跑的是我的demo程序.想要一级域名zhangruojun.com用来访问博客,二级域名demo. ...

  8. com.mysql.cj.exceptions.InvalidConnectionAttributeException: The server time zone value 'Öйú±ê׼ʱ¼

    起初这样能短暂解决问题,后来发现每次机器重启了就还是有这样的错误,还是要执行SQL,很麻烦: show variables like '%time_zone%'; select now(); set ...

  9. 【bzoj】3224: Tyvj 1728 普通平衡树

    3224: Tyvj 1728 普通平衡树 Time Limit: 10 Sec  Memory Limit: 128 MBSubmit: 10097  Solved: 4302[Submit][St ...

  10. WPF基础学习笔记整理 (五) DependencyObject & DependencyProperty

    参考资料: 1.http://www.cnblogs.com/Zhouyongh/archive/2009/10/20/1586278.html 基础知识: DependencyObject & ...