zipkin对于dubbo的支持
对于Web端:
1. 需要在applicationContext的头部添加中添加prefix引用:
xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
xsi:schemaLocation="...http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd"
2. 添加dubbo的过滤器(可以和webhttpTracing公用一个Tracing)
<dubbo:consumer filter="tracing" />
3. 在pom中添加dubbo rpc的引用
<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.zipkin.brave</groupId>
<artifactId>brave-bom</artifactId>
<version>${brave.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>y <dependency>
<groupId>io.zipkin.brave</groupId>
<artifactId>brave</artifactId>
</dependency>
<dependency>
<groupId>io.zipkin.brave</groupId>
<artifactId>brave-spring-beans</artifactId>
</dependency> <dependency>
<groupId>io.zipkin.reporter2</groupId>
<artifactId>zipkin-sender-okhttp3</artifactId>
</dependency>
<dependency>
<groupId>io.zipkin.brave</groupId>
<artifactId>brave-context-log4j12</artifactId>
</dependency>
<dependency>
<groupId>io.zipkin.brave</groupId>
<artifactId>brave-instrumentation-spring-web</artifactId>
</dependency>
<dependency>
<groupId>io.zipkin.brave</groupId>
<artifactId>brave-instrumentation-spring-webmvc</artifactId>
</dependency>
<dependency>
<groupId>io.zipkin.brave</groupId>
<artifactId>brave-instrumentation-dubbo-rpc</artifactId>
</dependency>
在Provider端:
1. applicationContext.xml文件(或者自定义的bean文件)中添加prefix引用以及添加tracing bean:
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="...http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd
<bean id="tracing" class="brave.spring.beans.TracingFactoryBean">
<property name="localServiceName" value="rpc-double" />
<property name="spanReporter">
<bean class="zipkin2.reporter.beans.AsyncReporterFactoryBean">
<property name="encoder" value="JSON_V2" />
<property name="sender">
<bean class="zipkin2.reporter.beans.URLConnectionSenderFactoryBean">
<property name="endpoint" value="http://10.4.120.77:9411/api/v2/spans" />
</bean>
</property>
<!-- wait up to half a second for any in-flight spans on close -->
<property name="closeTimeout" value="500" />
</bean>
</property>
<property name="propagationFactory">
<bean id="propagationFactory" class="brave.propagation.ExtraFieldPropagation"
factory-method="newFactory">
<constructor-arg index="0">
<util:constant static-field="brave.propagation.B3Propagation.FACTORY" />
</constructor-arg>
<constructor-arg index="1">
<list>
<value>user-name</value>
</list>
</constructor-arg>
</bean>
</property>
<property name="currentTraceContext">
<bean class="brave.context.log4j12.MDCCurrentTraceContext"
factory-method="create" />
</property>
</bean>
2. 添加tracing bean
<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.zipkin.brave</groupId>
<artifactId>brave-bom</artifactId>
<version>${brave.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependency>
<groupId>io.zipkin.brave</groupId>
<artifactId>brave</artifactId>
</dependency>
<dependency>
<groupId>io.zipkin.brave</groupId>
<artifactId>brave-spring-beans</artifactId>
</dependency>
<dependency>
<groupId>io.zipkin.reporter2</groupId>
<artifactId>zipkin-reporter-spring-beans</artifactId>
</dependency>
<dependency>
<groupId>io.zipkin.reporter2</groupId>
<artifactId>zipkin-sender-urlconnection</artifactId>
</dependency>
<dependency>
<groupId>io.zipkin.reporter2</groupId>
<artifactId>zipkin-sender-okhttp3</artifactId>
</dependency>
<dependency>
<groupId>io.zipkin.brave</groupId>
<artifactId>brave-instrumentation-dubbo-rpc</artifactId>
</dependency>
<dependency>
<groupId>io.zipkin.brave</groupId>
<artifactId>brave-context-log4j12</artifactId>
</dependency>
坑
zipkin对于dubbo的支持的更多相关文章
- 服务化改造实践 | 如何在 Dubbo 中支持 REST
什么是 REST REST 是 Roy Thomas Fielding [[1]](#fn1) 在 2000 年他的博士论文 [[2]](#fn2) “架构风格以及基于网络的软件架构设计” 中提出来的 ...
- Dubbo如何支持本地调用?injvm方式解析
Dubbo是一个远程调用的框架,对于一个服务提供者,暴露了一个接口供外部消费者调用,那么对于提供者自己是否可以调用这个接口,需要什么特殊处理吗? 这篇文章就分享下Dubbo关于本地调用的实现机制,以及 ...
- Dubbo多协议支持
除了Dubbo服务暴露协议Dubbo协议外,Dubbo框架还支持另外8种服务暴露协议:RMI协议.Hessian协议.HTTP协议.WebService协议.Thrift协议.Memcached协议. ...
- 原理分析dubbo分布式应用中使用zipkin做链路追踪
zipkin是什么 Zipkin是一款开源的分布式实时数据追踪系统(Distributed Tracking System),基于 Google Dapper的论文设计而来,由 Twitter 公司开 ...
- TarsGo新版本发布,支持protobuf,zipkin和自定义插件
本文作者:陈明杰(sandyskies) Tars是腾讯从2008年到今天一直在使用的后台逻辑层的统一应用框架,目前支持C++,Java,PHP,Nodejs,Golang语言.该框架为用户提供了涉及 ...
- dubbo支持协议及具体对比
对dubbo的协议的学习,可以知道目前主流RPC通信大概是什么情况,本文参考dubbo官方文档 http://dubbo.io/User+Guide-zh.htm dubbo共支持如下几种通信协议: ...
- 原理分析dubbo分布式应用中使用zipkin做链路追踪(转)
作者:@nele本文为作者原创,转载请注明出处:https://www.cnblogs.com/nele/p/10171794.html 目录 zipkin是什么为什么使用Zipkinzipkin架构 ...
- Dubbo 在跨语言和协议穿透性方向的探索:支持 HTTP/2 gRPC
Dubbo 在跨语言和协议穿透性方向上的探索:支持 HTTP/2 gRPC 和 Protobuf 本文整理自刘军在 Dubbo 成都 meetup 上分享的<Dubbo 在多语言和协议穿透性方向 ...
- dubbo 相关面试题 有用
调用关系说明: · 0. 服务容器负责启动,加载,运行服务提供者. · 1. 服务提供者在启动时,向注册中心注册自己提供的服务. · 2. 服务消费者在启动时,向注册中心订阅自己所需的服务. · 3. ...
随机推荐
- HDU1160FatMouse's Speed
#include<stdio.h> #include<string.h> #include<algorithm> #include<set> #incl ...
- eclipse 项目svn忽略不需要提交的文件
1.eclipse选择window–>Prenference 2.选择Team–> Git下面的Ignoreed Resources –>Add Pattern –>一个一个的 ...
- vs+qt使用资源文件
1.在Resources目录新建一个.qrc文件 2.在解决方案的Resource Files中添加这个文件 3.为这个qrc添加资源,建议把资源都放进Resources
- Android 旋转、平移、缩放和透明度渐变的补间动画
补间动画就是通过对场景里的对象不断进行图像变化来产生动画效果.在实现补间动画时,只需要定义开始和结束的“关键帧”,其他过渡帧由系统自动计算并补齐.在Android中,提供了以下4种补间动画. **1. ...
- js urlencode
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- python 解压zip压缩包
在当前路径解压zip压缩包,生成同名文件夹,内部目录结构与压缩包一致 import zipfile import os def un_zip(file_name): """ ...
- CSS 再学习,基础篇
语法 h1 {color:red; font-size:14px;} 共享声明 h1,h2,h3,h4,h5,h6 { color: green; } 继承 通过 CSS 继承,子元素将继承最高级元素 ...
- 定义 S4 类
S3 类仅用一个字符向量表示,与之不同的是,S4 类要求对类和方法有正式定义.为了定义一个 S4 类,我们需要调用 setClass( ),并提供一种类成员的表示,这种表示被称为字段(slots).通 ...
- [sql]SET NOCOUNT ON 的作用
使返回的结果中不包含有关受 Transact-SQL 语句影响的行数的信息. 说明: 场景1:(不使用SET NOCOUNT) 场景2:(使用SET NOCOUNT ON ) 场景3:(使用SET N ...
- bzoj1143: [CTSC2008]祭祀river 最长反链
题意:在遥远的东方,有一个神秘的民族,自称Y族.他们世代居住在水面上,奉龙王为神.每逢重大庆典, Y族都会在水面上举办盛大的祭祀活动.我们可以把Y族居住地水系看成一个由岔口和河道组成的网络.每条河道连 ...