| <!doctype html> |
| <!-- |
| Minimal Mistakes Jekyll Theme 4.4.1 by Michael Rose |
| Copyright 2017 Michael Rose - mademistakes.com | @mmistakes |
| Free for personal and commercial use under the MIT license |
| https://github.com/mmistakes/minimal-mistakes/blob/master/LICENSE.txt |
| --> |
| <html lang="cn" class="no-js"> |
| <head> |
| <meta charset="utf-8"> |
| |
| <!-- begin SEO --> |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| <title>分布式调用链追踪 - Apache ServiceComb</title> |
| |
| |
| |
| |
| <meta name="description" content="介绍如何在体质指数应用中使用ServiceComb提供的分布式追踪能力"> |
| |
| |
| |
| |
| <meta name="author" content=""> |
| |
| <meta property="og:locale" content="cn"> |
| <meta property="og:site_name" content="Apache ServiceComb"> |
| <meta property="og:title" content="分布式调用链追踪"> |
| |
| |
| <link rel="canonical" href="https://github.com/pages/apache/incubator-servicecomb-website/cn/docs/mesher-quick-start-advance/mesher-distributed-tracing/"> |
| <meta property="og:url" content="https://github.com/pages/apache/incubator-servicecomb-website/cn/docs/mesher-quick-start-advance/mesher-distributed-tracing/"> |
| |
| |
| |
| <meta property="og:description" content="介绍如何在体质指数应用中使用ServiceComb提供的分布式追踪能力"> |
| |
| |
| |
| <meta name="twitter:site" content="@ServiceComb"> |
| <meta name="twitter:title" content="分布式调用链追踪"> |
| <meta name="twitter:description" content="介绍如何在体质指数应用中使用ServiceComb提供的分布式追踪能力"> |
| <meta name="twitter:url" content=""> |
| |
| |
| <meta name="twitter:card" content="summary"> |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| <script type="application/ld+json"> |
| { |
| "@context" : "http://schema.org", |
| "@type" : "Person", |
| "name" : "Apache ServiceComb", |
| "url" : "https://github.com/pages/apache/incubator-servicecomb-website", |
| "sameAs" : null |
| } |
| </script> |
| |
| |
| |
| <meta name="google-site-verification" content="HvJjNd7vvJ-yjSTHlBiIWEYxp_Hrz-PYEY5Idz9LRcA" /> |
| |
| |
| |
| |
| <!-- end SEO --> |
| |
| |
| <link href="/feed.xml" type="application/atom+xml" rel="alternate" title="Apache ServiceComb Feed"> |
| |
| <!-- http://t.co/dKP3o1e --> |
| <meta name="HandheldFriendly" content="True"> |
| <meta name="MobileOptimized" content="320"> |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| |
| <script> |
| document.documentElement.className = document.documentElement.className.replace(/\bno-js\b/g, '') + ' js '; |
| </script> |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/1.7.1/clipboard.min.js"></script> |
| <script src="/assets/vendor/prism/prism.js"></script> |
| |
| <script type="text/javascript" async |
| src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-MML-AM_CHTML"> |
| </script> |
| |
| <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" integrity="sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M" crossorigin="anonymous"> |
| |
| <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script> |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js" integrity="sha384-b/U6ypiBEHpOf/4+1nzFpr53nxSS+GLCkfwBdFNTxtclqqenISfwAzpKaMNFNmj4" crossorigin="anonymous"></script> |
| <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/js/bootstrap.min.js" integrity="sha384-h0AbiXch4ZDo7tp9hKZ4TsHbi047NrKGLO3SEJAg45jXxnGIfYzk4Si90RDIqNm1" crossorigin="anonymous"></script> |
| <!-- For all browsers --> |
| <link rel="stylesheet" href="/assets/css/main.css?v=1"> |
| <link rel="stylesheet" href="/assets/vendor/prism/prism.css?v=1"> |
| |
| <!--[if lte IE 9]> |
| <style> |
| /* old IE unsupported flexbox fixes */ |
| .greedy-nav .site-title { |
| padding-right: 3em; |
| } |
| .greedy-nav button { |
| position: absolute; |
| top: 0; |
| right: 0; |
| height: 100%; |
| } |
| </style> |
| <![endif]--> |
| |
| <meta http-equiv="cleartype" content="on"> |
| |
| <!-- start custom head snippets --> |
| |
| <!-- insert favicons. use http://realfavicongenerator.net/ --> |
| <link href="https://fonts.cat.net/css?family=Roboto:400,500,700|Source+Code+Pro" rel="stylesheet"> |
| <script src="/assets/js/custom.js"></script> |
| <!-- end custom head snippets --> |
| |
| </head> |
| |
| <body class="layout--single"> |
| |
| <!--[if lt IE 9]> |
| <div class="notice--danger align-center" style="margin: 0;">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</div> |
| <![endif]--> |
| <div class="masthead" onmouseleave="$('#childrenShow').css('display', 'none')"> |
| <div class="masthead__inner-wrap"> |
| <div class="masthead__menu"> |
| <nav id="site-nav" class="greedy-nav"> |
| |
| <a class="site-title active" href="/cn"><img src="https://www.apache.org/img/servicecomb.png"></a> |
| |
| <ul class="visible-links"> |
| |
| |
| |
| |
| |
| <li class="masthead__menu-item" onmouseenter="$('#childrenShow').css('display', 'none')"> |
| |
| <a href="/cn/">首页</a> |
| |
| </li> |
| |
| |
| |
| |
| |
| |
| <li class="masthead__menu-item" onmouseenter="$('#childrenShow').css('display', 'none')"> |
| |
| <a href="/cn/developers/">项目</a> |
| |
| </li> |
| |
| |
| |
| |
| |
| |
| <li class="def-nav-li" onmouseenter="$('#childrenShow').css('display', 'block')"> |
| |
| |
| |
| |
| |
| <a href="/cn/docs/users/">文档</a> |
| |
| |
| <ul id="childrenShow" class="def-children-show" onmouseleave="$('#childrenShow').css('display', 'none')"> |
| |
| <li><a href="/cn/docs/quick-start/" class="">入门指南</a></li> |
| |
| <li><a href="/cn/docs/users/" class="">用户手册</a></li> |
| |
| <li><a href="/cn/slides/" class="">大咖视频</a></li> |
| |
| <li><a href="/cn/faqs/" class="">常见问题</a></li> |
| |
| </ul> |
| </li> |
| |
| |
| |
| |
| |
| |
| <li class="masthead__menu-item" onmouseenter="$('#childrenShow').css('display', 'none')"> |
| |
| <a href="/cn/developers/contributing">社区</a> |
| |
| </li> |
| |
| |
| |
| |
| |
| |
| <li class="masthead__menu-item" onmouseenter="$('#childrenShow').css('display', 'none')"> |
| |
| <a href="/cn/year-archive/">博文</a> |
| |
| </li> |
| |
| |
| |
| |
| |
| |
| <li class="masthead__menu-item" onmouseenter="$('#childrenShow').css('display', 'none')"> |
| |
| <a href="/cn/release/">下载</a> |
| |
| </li> |
| |
| |
| </ul> |
| <button><div class="navicon"></div></button> |
| <ul class="hidden-links hidden"></ul> |
| <div class="nav-lang"> |
| |
| |
| |
| <a href=/docs/mesher-quick-start-advance/mesher-distributed-tracing/>English</a> |
| |
| </div> |
| </nav> |
| </div> |
| </div> |
| </div> |
| |
| |
| |
| |
| |
| |
| <div id="main" role="main"> |
| |
| <div class="sidebar sticky"> |
| |
| <div class="back-to-home"><a href="/cn/">首页</a> > 分布式调用链追踪</div> |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| <nav class="nav__list"> |
| |
| <input id="ac-toc" name="accordion-toc" type="checkbox" /> |
| <label for="ac-toc">切换菜单</label> |
| <ul class="nav__items"> |
| |
| <li> |
| |
| |
| |
| |
| <a href="/cn/docs/getting-started/"><span class="nav__sub-title nav__sub-title-with-url">入门指南</span></a> |
| |
| |
| |
| </li> |
| |
| <li> |
| |
| <span class="nav__sub-title">服务中心 Service-Center</span> |
| |
| |
| |
| <ul> |
| |
| |
| |
| |
| |
| |
| |
| <li><a href="/cn/docs/service-center/install/" class="">环境安装</a></li> |
| |
| |
| |
| |
| |
| |
| |
| <li><a href="/cn/docs/service-center/registration-discovery/" class="">服务注册发现</a></li> |
| |
| </ul> |
| |
| </li> |
| |
| <li> |
| |
| <span class="nav__sub-title">基于java微服务SDK开发微服务应用</span> |
| |
| |
| |
| <ul> |
| |
| |
| |
| |
| |
| |
| |
| <li><a href="/cn/docs/quick-start/" class="">入门指南</a></li> |
| |
| |
| |
| |
| |
| |
| |
| <li><a href="/cn/docs/quick-start-bmi/" class="">体质指数微服务应用快速开发</a></li> |
| |
| |
| |
| |
| |
| |
| |
| <li><a href="/cn/docs/quick-start-advance/" class="">微服务开发进阶</a></li> |
| |
| |
| |
| |
| |
| |
| |
| <li><a href="/cn/docs/quick-start-advance/load-balance/" class="">负载均衡</a></li> |
| |
| |
| |
| |
| |
| |
| |
| <li><a href="/cn/docs/quick-start-advance/flow-control/" class="">流量控制</a></li> |
| |
| |
| |
| |
| |
| |
| |
| <li><a href="/cn/docs/quick-start-advance/service-management/" class="">服务治理</a></li> |
| |
| |
| |
| |
| |
| |
| |
| <li><a href="/cn/docs/quick-start-advance/distributed-tracing/" class="">分布式调用链追踪</a></li> |
| |
| </ul> |
| |
| </li> |
| |
| <li> |
| |
| <span class="nav__sub-title">使用mesher接入servicecomb微服务体系</span> |
| |
| |
| |
| <ul> |
| |
| |
| |
| |
| |
| |
| |
| <li><a href="/cn/docs/mesher-quick-start/" class="">入门指南</a></li> |
| |
| |
| |
| |
| |
| |
| |
| <li><a href="/cn/docs/mesher-quick-start-advance/" class="">mesher进阶</a></li> |
| |
| |
| |
| |
| |
| |
| |
| <li><a href="/cn/docs/mesher-quick-start-advance/mesher-load-balance/" class="">mesher负载均衡</a></li> |
| |
| |
| |
| |
| |
| |
| |
| <li><a href="/cn/docs/mesher-quick-start-advance/mesher-flow-control/" class="">mesher流量控制</a></li> |
| |
| |
| |
| |
| |
| |
| |
| <li><a href="/cn/docs/mesher-quick-start-advance/mesher-service-management/" class="">mesher服务治理</a></li> |
| |
| |
| |
| |
| |
| |
| |
| <li><a href="/cn/docs/mesher-quick-start-advance/mesher-distributed-tracing/" class="active">mesher分布式调用链追踪</a></li> |
| |
| </ul> |
| |
| </li> |
| |
| <li> |
| |
| <span class="nav__sub-title">一键微服务开发工具 Toolkit</span> |
| |
| |
| |
| <ul> |
| |
| |
| |
| |
| |
| |
| |
| <li><a href="/cn/docs/toolkit/quick-start/" class="">入门指南</a></li> |
| |
| |
| |
| |
| |
| |
| |
| <li><a href="/cn/docs/toolkit/oas-validator/" class="">OpenAPI V3 Spec校验工具</a></li> |
| |
| </ul> |
| |
| </li> |
| |
| <li> |
| |
| <span class="nav__sub-title">异构、多服务中心通讯 Syncer</span> |
| |
| |
| |
| <ul> |
| |
| |
| |
| |
| |
| |
| |
| <li><a href="/cn/docs/syncer/quick-start/" class="">入门指南</a></li> |
| |
| |
| |
| |
| |
| |
| |
| <li><a href="/cn/docs/syncer/multi-servicecenters/" class="">异构服务中心通讯</a></li> |
| |
| </ul> |
| |
| </li> |
| |
| </ul> |
| </nav> |
| |
| |
| |
| </div> |
| |
| |
| |
| <article class="page" itemscope itemtype="http://schema.org/CreativeWork"> |
| <meta itemprop="headline" content="分布式调用链追踪"> |
| <meta itemprop="description" content="介绍如何在体质指数应用中使用ServiceComb提供的分布式追踪能力"> |
| |
| <meta itemprop="dateModified" content="August 08, 2019"> |
| |
| <div class="page__inner-wrap"> |
| |
| |
| <header> |
| <h1 class="page__title" itemprop="headline">分布式调用链追踪 |
| </h1> |
| |
| </header> |
| |
| |
| |
| <section class="page__content" itemprop="text"> |
| <ul> |
| <li>分布式调用链追踪提供追溯微服务调用关系和调用处理时延的能力,便于用户检查分布式环境中微服务的健康状态。本指南将展示如何使用 <strong>mesher</strong> 提供的分布式调用链追踪能力。</li> |
| </ul> |
| |
| <h1 id="前言">前言</h1> |
| |
| <ul> |
| <li>在您进一步阅读之前,请确保您已阅读了<a href="/cn/docs/mesher-quick-start/">mesher快速入门</a>,并已成功运行用例服务。</li> |
| </ul> |
| |
| <h1 id="启用">启用</h1> |
| |
| <ul> |
| <li> |
| <p>1、mesher main文件中添加对zipkin库依赖:</p> |
| |
| <div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>_ <span class="s2">"github.com/go-chassis/go-chassis-plugins/tracing/zipkin"</span> |
| </code></pre></div> </div> |
| </li> |
| <li> |
| <p>2、启发器bootstrap.go中添加默认处理函数,如图中箭头所示:</p> |
| |
| <p><img src="/assets/images/mesher/mesher-tracing-func.png" alt="流量控制效果图" /></p> |
| </li> |
| <li> |
| <p>3、重新编译,分别替换<strong>mesher_webapp</strong>和<strong>mesher_calculator</strong>的可执行文件,启动mesher服务;</p> |
| </li> |
| <li> |
| <p>4、使用<strong>Docker</strong>运行<a href="http://servicecomb.apache.org/cn/docs/quick-start-advance/distributed-tracing/">Zipkin分布式追踪服务</a></p> |
| |
| <div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>docker run <span class="nt">-d</span> <span class="nt">-p</span> 9411:9411 openzipkin/zipkin |
| </code></pre></div> </div> |
| </li> |
| <li> |
| <p>5、多次点击 <em>Submit</em> 按钮发起服务调用;</p> |
| </li> |
| <li> |
| <p>6、打开 <a href="http://192.168.88.64:9411">http://192.168.88.64:9411</a>可查看分布式追踪结果如图,可以通过host地址判断调用路径:</p> |
| |
| <p><img src="/assets/images/mesher/mesher-tracing-30111.png" alt="分布式追踪效果图" /></p> |
| </li> |
| </ul> |
| |
| <h1 id="下一步">下一步</h1> |
| |
| <ul> |
| <li> |
| <p>了解更多<a href="/cn/users/distributed-tracing/">分布式调用链追踪</a></p> |
| </li> |
| <li> |
| <p>阅读<a href="/cn/docs/tracing-with-servicecomb/">基于 ServiceComb 和 Zipkin 的分布式调用链追踪</a>来进一步了解分布式追踪</p> |
| </li> |
| <li> |
| <p>认识 <a href="/cn/users/"><strong>ServiceComb</strong> 微服务开发框架</a></p> |
| </li> |
| <li> |
| <p>通过 <a href="/cn/docs/linuxcon-workshop-demo/">Company应用</a> 更深入地了解微服务开发</p> |
| </li> |
| </ul> |
| |
| |
| </section> |
| |
| <footer class="page__meta"> |
| |
| |
| |
| |
| |
| </footer> |
| |
| |
| |
| |
| |
| </div> |
| |
| |
| </article> |
| |
| |
| |
| </div> |
| |
| |
| <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> |
| <div align="center" style="margin: 0 0;"> |
| <ins class="adsbygoogle" |
| style="display:block; border-bottom: initial;" |
| data-ad-client="ca-pub-7328585512091257" |
| data-ad-slot="3049671934" |
| data-ad-format="auto"></ins> |
| </div> |
| |
| <div class="page__footer"> |
| <footer> |
| <!-- start custom footer snippets --> |
| |
| <!-- end custom footer snippets --> |
| |
| <div class="container"> |
| <div class="row justify-content-md-center"> |
| |
| <div class="col"> |
| <ul> |
| <p class="header">资源</p> |
| <li><a href="/cn/docs/quick-start/">入门指南</a></li> |
| <li><a href="/cn/users/">用户指南</a></li> |
| <li><a href="/cn/slides/">资料</a></li> |
| <li><a href="/cn/users/faq/">常见问题</a></li> |
| </ul> |
| </div> |
| <div class="col"> |
| <ul> |
| <p class="header">ASF</p> |
| <li><a href="http://www.apache.org">基金会</a></li> |
| <li><a href="http://www.apache.org/licenses/">许可证</a></li> |
| <li><a href="http://www.apache.org/events/current-event">活动</a></li> |
| <li><a href="http://www.apache.org/foundation/sponsorship.html">赞助</a></li> |
| <li><a href="http://www.apache.org/foundation/thanks.html">鸣谢</a></li> |
| </ul> |
| </div> |
| <div class="col"> |
| <ul> |
| <p class="header">贡献</p> |
| <li><a href="http://issues.apache.org/jira/browse/SCB">报告本网页问题</a></li> |
| <li><a href="https://github.com/apache/servicecomb-website/edit/master/_docs/cn/mesher-distributed-tracing.md">在Github上编辑此页</a></li> |
| <li><a href="/cn/developers/submit-codes/">代码提交指南</a></li> |
| <li><a href="/cn/security">安全</a></li> |
| </ul> |
| </div> |
| <div class="col"> |
| <ul class="social-icons"> |
| <p class="header">社区</p> |
| <li> |
| <a href="mailto:dev-subscribe@servicecomb.incubator.apache.org" rel="nofollow"><span class="mail">邮件列表</span></a> |
| </li> |
| <li> |
| <a href="https://github.com/apache?q=ServiceComb" target="_blank"><span class="github">Github</span></a> |
| </li> |
| <li> |
| <a href="https://twitter.com/ServiceComb" target="_blank"><span class="twitter">Twitter</span></a> |
| </li> |
| <li> |
| <a href="/feed.xml" target="_blank"><span class="rss">Feed</span></a> |
| </li> |
| </ul> |
| </div> |
| </div> |
| </div> |
| <div class="page__footer-bottom"> |
| <div>© 2019 Apache ServiceComb. 技术来自于 <a href="http://jekyllrb.com" rel="nofollow">Jekyll</a> & <a href="https://mademistakes.com/work/minimal-mistakes-jekyll-theme/" rel="nofollow">Minimal Mistakes</a>.</div> |
| <div>All other marks mentioned may be trademarks or registered trademarks of their respective owners.</div> |
| </div> |
| |
| </footer> |
| </div> |
| |
| <script src="/assets/js/main.min.js"></script> |
| |
| |
| |
| |
| <script> |
| (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ |
| (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), |
| m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) |
| })(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); |
| |
| ga('create', 'UA-101622733-1', 'auto'); |
| ga('send', 'pageview'); |
| </script> |
| |
| |
| |
| |
| |
| |
| |
| </body> |
| </html> |