[译]Ocelot - Tracing

原文

Ocelot是使用的Butterfly这个项目来实现这个的。

在ocelot要使用tracing, 首先得安装相应的包:

Install-Package Ocelot.Tracing.Butterfly

然后再ConfigureServices方法里面添加如下代码:

services
    .AddOcelot()
    // 下面这个扩展方法来自Ocelot.Tracing.Butterfly包
    .AddButterfly(option =>
    {
        // 这个是butterfly服务器的地址
        option.CollectorUrl = "http://localhost:9618";
        option.Service = "Ocelot";
    });

最后添加下面的配置到你想要trace的ReRoute中:

"HttpHandlerOptions": {
      "UseTracing": true
  }
posted @ 2018-09-06 15:52  irocker  阅读(239)  评论(0编辑  收藏  举报