原文

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
  }

相关文章:

  • 2021-06-27
  • 2021-10-17
  • 2021-12-18
  • 2022-02-22
  • 2021-08-20
  • 2021-12-13
  • 2021-05-30
  • 2021-08-02
猜你喜欢
  • 2022-01-16
  • 2021-10-30
  • 2021-11-25
  • 2021-08-17
  • 2022-02-11
  • 2022-01-20
  • 2021-06-22
相关资源
相似解决方案