Ocelot中文文档-跟踪(转)

原文地址:https://www.cnblogs.com/loogn/p/9007847.html

Ocelot使用一个杰出的项目Butterfly 提供了跟踪功能。

为了使用跟踪,请阅读Butterfly的文档。

在Ocelot中如果你想跟踪一个ReRoute,你需要做如下事情:

在ConfigureServices方法中

services
    .AddOcelot()
    .AddOpenTracing(option =>
    {
        //this is the url that the butterfly collector server is running on...
        option.CollectorUrl = "http://localhost:9618";
        option.Service = "Ocelot";
    });

然后在ocelot.json文件中,添加如下配置到你想要跟随的ReRoute中。

"HttpHandlerOptions": {
      "UseTracing": true
  },

现在,当这个ReRoute被调用的时候,Ocelot会发生跟踪信息到Butterfly。

posted @ 2018-06-07 17:33  snailteam  阅读(229)  评论(0编辑  收藏  举报