<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                [TOC] ### Jaeger-client(客戶端庫) ***** client是客戶端lib,便于不同語言的項目來介入到Jaeger中,當我們的應用程序裝載上之后,client會負責收集并發送數據到Agent。當前Jaeger的SDK支持有如下: ``` --官方 1.Go 2.Java 3.Node 4.Python 5.C++ --非官方 1.PHP 3.Others ``` client是支持OpenTracing標準的,如上文提到,Zipkin也是支持OpenTracing標準的,這也就意味著,我們的應用程序在嵌入Jaeger-client的地方,可以隨時替換成Zipkin,對業務是完全透明的。 ### Jaeger 客戶端庫的使用 ***** #### C++Jaeger客戶端的使用 github:[https://github.com/jaegertracing/jaeger-client-cpp](https://github.com/jaegertracing/jaeger-client-cpp) ##### Windows下編譯 使用Cmake編譯 ![UTOOLS1586855741629.png](https://user-gold-cdn.xitu.io/2020/4/14/17177f909eb05854?w=1091&h=578&f=png&s=23291) ##### Linux/MacOS下編譯 使用Cmake編譯 ##### 參考例子 [examples/App.cpp](https://github.com/jaegertracing/jaeger-client-cpp/blob/master/examples/App.cpp) ``` #include <iostream> #include <yaml-cpp/yaml.h> #include <jaegertracing/Tracer.h> namespace { void setUpTracer(const char* configFilePath) { auto configYAML = YAML::LoadFile(configFilePath); auto config = jaegertracing::Config::parse(configYAML); auto tracer = jaegertracing::Tracer::make( "test_service", config, jaegertracing::logging::consoleLogger()); opentracing::Tracer::InitGlobal( std::static_pointer_cast<opentracing::Tracer>(tracer)); } void tracedSubroutine(const std::unique_ptr<opentracing::Span>& parentSpan) { auto span = opentracing::Tracer::Global()->StartSpan( "tracedSubroutine", { opentracing::ChildOf(&parentSpan->context()) }); } void tracedFunction() { auto span = opentracing::Tracer::Global()->StartSpan("tracedFunction"); tracedSubroutine(span); } } // anonymous namespace int main(int argc, char* argv[]) { if (argc < 2) { std::cerr << "usage: " << argv[0] << " <config-yaml-path>\n"; return 1; } setUpTracer(argv[1]); tracedFunction(); // Not stricly necessary to close tracer, but might flush any buffered // spans. See more details in opentracing::Tracer::Close() documentation. opentracing::Tracer::Global()->Close(); return 0; } ``` 配置文件 config.yml: ``` disabled: false reporter: logSpans: true localAgentHostPort: 192.168.0.172:6831 endPoint: 192.168.0.172:16686/api/traces sampler: type: const param: 1 samplingServerURL: 192.168.0.172:5778/sampling ``` 執行命令: ``` app.exe config.yml ``` 生成: ``` INFO: Initializing logging reporter INFO: Reporting span a86faeec10eb5206:54619d0c57878022:a86faeec10eb5206:1 INFO: Reporting span a86faeec10eb5206:a86faeec10eb5206:0:1 ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看