motan学习笔记 一 微博轻量级RPC框架Motan

motan学习笔记 二 motan架构分析

motan学习笔记 三 motan Demo 分析

motan学习笔记 四 motan Demo 之yar 分析

motan学习笔记 五 opentracing学习入门

motan学习笔记 六 opentracing Brave+zipkin实现

opentracing是什么?

opentracing(http://opentracing.io/)  是分布式跟踪系统,当我们把系统拆成服务化,分布式系统的时候,查询一个问题,很可能需要多个登录多台机器。
opentracing 定义了一套api
通过提供平台无关、厂商无关的API,使得开发人员能够方便的添加(或更换)追踪系统的实现。OpenTracing正在为全球的分布式追踪,提供统一的概念和数据标准。

opentracing 在哪里有java版?

从github,下载java版本的分支( https://github.com/opentracing/opentracing-java)
从下面的图,可以看出api为定义模块,mock挡板 noop空实现  impl具体实现

opentracing 定义了哪些api?

span

一条消息,相当于一个打点信息,里面有两个重要的方法   finish 和 其他
finish 用来完成span的信息,并且用于提交 而其他方法用来组装span的数据

SpanContext

及传输的上下文,保存一些数据,一般loaclThread的,主要方法

Iterable<Map.Entry<String, String>> baggageItems();

Tracer

定义了两个方法,一个是往spancontext 插入参数,一个获取spancontext,相当于span集合
<C> void inject(SpanContext spanContext, Format<C> format, C carrier);
<C> SpanContext extract(Format<C> format, C carrier);
Format其实就是 定义的几个map  
public interface Format<C> {final class Builtin<C> implements Format<C> { public final static Format<TextMap> TEXT_MAP = new Builtin<TextMap>();public final static Format<TextMap> HTTP_HEADERS = new Builtin<TextMap>();public final static Format<ByteBuffer> BINARY = new Builtin<ByteBuffer>();}

SpanBuilder

顾名思义,builder模式,用来构建 span, 关键是start方法,构建成功

interface SpanBuilder extends SpanContext {/*** A shorthand for addReference(References.CHILD_OF, parent).*/SpanBuilder asChildOf(SpanContext parent);/*** A shorthand for addReference(References.CHILD_OF, parent.context()).*/SpanBuilder asChildOf(Span parent);/*** Add a reference from the Span being built to a distinct (usually parent) Span. May be called multiple times to* represent multiple such References.** @param referenceType the reference type, typically one of the constants defined in References* @param referencedContext the SpanContext being referenced; e.g., for a References.CHILD_OF referenceType, the*                          referencedContext is the parent** @see io.opentracing.References*/SpanBuilder addReference(String referenceType, SpanContext referencedContext);/** Same as {@link Span#setTag(String, String)}, but for the span being built. */SpanBuilder withTag(String key, String value);/** Same as {@link Span#setTag(String, String)}, but for the span being built. */SpanBuilder withTag(String key, boolean value);/** Same as {@link Span#setTag(String, String)}, but for the span being built. */SpanBuilder withTag(String key, Number value);/** Specify a timestamp of when the Span was started, represented in microseconds since epoch. */SpanBuilder withStartTimestamp(long microseconds);/** Returns the started Span. */Span start();}

motan学习笔记 五 opentracing学习入门相关推荐

  1. 吴恩达《机器学习》学习笔记五——逻辑回归

    吴恩达<机器学习>学习笔记五--逻辑回归 一. 分类(classification) 1.定义 2.阈值 二. 逻辑(logistic)回归假设函数 1.假设的表达式 2.假设表达式的意义 ...

  2. python函数是一段具有特定功能的语句组_Python学习笔记(五)函数和代码复用

    本文将为您描述Python学习笔记(五)函数和代码复用,具体完成步骤: 函数能提高应用的模块性,和代码的重复利用率.在很多高级语言中,都可以使用函数实现多种功能.在之前的学习中,相信你已经知道Pyth ...

  3. Ethernet/IP 学习笔记五

    Ethernet/IP 学习笔记五 Accessing data within a device using a non-time critical message (an explicit mess ...

  4. 深度学习入门之PyTorch学习笔记:深度学习介绍

    深度学习入门之PyTorch学习笔记:深度学习介绍 绪论 1 深度学习介绍 1.1 人工智能 1.2 数据挖掘.机器学习.深度学习 1.2.1 数据挖掘 1.2.2 机器学习 1.2.3 深度学习 第 ...

  5. Bootstrap学习笔记01【快速入门、栅格布局】

    Java后端 学习路线 笔记汇总表[黑马程序员] Bootstrap学习笔记01[快速入门.栅格布局][day01] Bootstrap学习笔记02[全局CSS样式.组件和插件.案例_黑马旅游网][d ...

  6. StackExchange.Redis学习笔记(五) 发布和订阅

    StackExchange.Redis学习笔记(五) 发布和订阅 原文:StackExchange.Redis学习笔记(五) 发布和订阅 Redis命令中的Pub/Sub Redis在 2.0之后的版 ...

  7. Flowable学习笔记(一、入门)

    转载自  Flowable学习笔记(一.入门) 一.Flowable简介 1.Flowable是什么 Flowable是一个使用Java编写的轻量级业务流程引擎.Flowable流程引擎可用于部署BP ...

  8. 好程序员教程分析Vue学习笔记五

    好程序员教程分析Vue学习笔记五,上次我们学习了Vue的组件,这次我们来学习一下路由的使用.在Vue中,所谓的路由其实跟其他的框架中的路由的概念差不多,即指跳转的路径. 注意:在Vue中,要使用路由, ...

  9. 前端学习笔记:Bootstrap框架入门

    前端学习笔记:Bootstrap框架入门 一.Bootstrap概述 1.基本信息 ​Bootstrap,来自 Twitter,是目前很受欢迎的前端框架.Bootstrap 是基于 HTML.CSS. ...

最新文章

  1. redis使用watch完成秒杀抢购功能
  2. superset各种数据库连接地址(持续更新中)
  3. 理解什么是前后端分离
  4. html中的异步请求数据格式,解决layui中table异步数据请求不支持自定义返回数据格式的问题...
  5. zoj 1074 To the MAX
  6. java用cookie最新浏览商品_jQuery.cookie.js实现记录最近浏览过的商品功能示例
  7. Matlab图形窗口大小的控制 ,plot窗口大小,figure大小,axis设置
  8. android投影到创维电视,创维Miracast,手机怎么投屏到创维电视,
  9. cad导出pdf_CAD手机看图软件中怎么将CAD图纸转为PDF/图片格式?
  10. MTG1000中继网关用户手册
  11. 零基础如何开始学素描?
  12. MacBook Pro键盘功能盘点
  13. win32.mak下载地址github
  14. 工商银行网银U盾在win7 64位操作系统无法使用的问题
  15. python读写html文件乱码问题
  16. 连接多个内网的方法,想连多少个连多少个
  17. 英语词根词缀记忆法(全集)_掌握了英语词根词缀,就能迅速记下单词,快速提升词汇量...
  18. border渐变 ios_IOS画渐变的三种方式
  19. 阿里云短信认证实现过程
  20. 张驰杭州电子科技计算机学院,计算机学院举办“图灵教育计划”电子信息科学与技术专业交流会...

热门文章

  1. chrome浏览器中用 F12 进行抓包
  2. xshell个人免费版下载使用
  3. c语言闯关考试题讲解,程序员面试闯关(二):数据结构考点与细节分析
  4. Visual Studio 默认编码为 utf-8
  5. 珍贵!分享!全国各省市最全乡镇、街道行政区划边界shp矢量数据+wgs84坐标系+2021年7月最新获取+2018年更新数据
  6. css中repeat用法,background-repeat 怎么使用
  7. vue实现页面全屏和退出全屏
  8. 电子商务网站:SEO优化的15个基本技巧!
  9. 生日悖论MATLAB仿真
  10. “AI+”将比“互联网+”落地更容易