Esempio n. 1
0
    def ignore_check(self, op: str, kind: Kind):
        suffix_idx = op.rfind(".")
        if suffix_idx > -1 and config.ignore_suffix.find(op[suffix_idx:]) > -1:
            return NoopSpan(
                context=NoopContext(),
                kind=kind,
            )
        if config.trace_ignore:
            for pattern in config.trace_ignore_path:
                if fast_path_match(pattern, op):
                    return NoopSpan(
                        context=NoopContext(),
                        kind=kind,
                    )

        return None
Esempio n. 2
0
    def ignore_check(self, op: str, kind: Kind):
        if config.RE_IGNORE_PATH.match(op):
            return NoopSpan(
                context=NoopContext(),
                kind=kind,
            )

        return None
Esempio n. 3
0
 def ignore_check(self, op: str, kind: Kind):
     suffix_idx = op.rfind(".")
     if suffix_idx > -1 and config.ignore_suffix.find(op[suffix_idx:]) > -1:
         return NoopSpan(
             context=NoopContext(),
             kind=kind,
         )
     return None
Esempio n. 4
0
class NoopContext(SpanContext):
    def __init__(self):
        super().__init__()
        self._depth = 0
        self._noop_span = NoopSpan(self, kind=Kind.Local)
        self.correlation = {}  # type: dict

    def new_local_span(self, op: str) -> Span:
        return self._noop_span

    def new_entry_span(self,
                       op: str,
                       carrier: 'Carrier' = None,
                       inherit: Component = None) -> Span:
        if carrier is not None:
            self._noop_span.extract(carrier)
        return self._noop_span

    def new_exit_span(self,
                      op: str,
                      peer: str,
                      component: Component = None,
                      inherit: Component = None) -> Span:
        return self._noop_span

    def start(self, span: Span):
        self._depth += 1

    def stop(self, span: Span) -> bool:
        self._depth -= 1
        return self._depth == 0

    def active_span(self):
        return self._noop_span

    def capture(self):
        return Snapshot(
            segment_id=None,
            span_id=-1,
            trace_id=None,
            endpoint=None,
            correlation=self._correlation,
        )

    def continued(self, snapshot: 'Snapshot'):
        self._correlation.update(snapshot.correlation)
Esempio n. 5
0
 def __init__(self):
     super().__init__()
     self._depth = 0
     self._noop_span = NoopSpan(self, kind=Kind.Local)
     self.correlation = {}  # type: dict
Esempio n. 6
0
 def __init__(self):
     super().__init__()
     self._depth = 0
     self._noop_span = NoopSpan(self, kind=Kind.Local)