Coder Social home page Coder Social logo

Comments (4)

guanchao-yang avatar guanchao-yang commented on June 3, 2024

比如只要任意一个span包含了error=true的tag, 整个trace应该被收集采样

@quaff 这里可以通过我们提供的自定义的采样规则接口,然后自己实现这个规则达成目标哈。

还需要支持已采样的trace里面可以让用户定义规则来删掉某些span, 比如跨度时间小于某个值, 这种很小的span通常对跟踪分析没多大作用

@quaff 同样,这个也是可以作为一个采样规则实现完成目标,开发者在构建 Tracer 的时候,可以传递不同的采样规则策略来达到目标。采样策略上,在这个链路上,应该保持一致,否则也会出现链路不全的情况。

欢迎给我们 PR 来丰富我们的采样规则哈。感谢。

from sofa-tracer.

quaff avatar quaff commented on June 3, 2024

你们提供的采样规则接口, 只能根据operation和traceId作为依据判断, 没有办法深入到具体的span里面去, 要实现我提到的采样规则, 这个接口是不够的.
链路不全的情况是要靠二次加工来实现, 如果是叶子节点直接丢弃就可以, 如果是中间节点则把子节点往上移, 把父spanId设置为爷spanId.

from sofa-tracer.

guanchao-yang avatar guanchao-yang commented on June 3, 2024

有办法深入到具体的span里面

@quaff 是的。我们会在尽快优化掉这个问题。 具体 issue 见这里

@glmapper 关注

from sofa-tracer.

glmapper avatar glmapper commented on June 3, 2024

采样方案:
1、在sofaTracer进行reportSpan操作时,如果当前span的父span不存在,则认为当前span是rootSpan,这里将当前采样算法计算得到的isSampled值塞到SofaTracerSpanContext中。
2、在执行inject操作时,carrier 中增加采样透传数据。
3、采样配置参数:

  • a、采样策略名称 samplerName,该配置与Sampler中的TYPE保持一致
  • b、采样率 samplerPercentage,在使用SofaTracerPercentageBasedSampler采样策略时使用。
  • c、自定义采样规则 类全限定名 samplerCustomRuleClassName,当采样策略为 OpenRulesSampler 时必须配置。

from sofa-tracer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.