public IScope Activate(ISpan span, bool finishSpanOnDispose) { // Now we activate our span and not the wrapped one // We don't have to pass it the wrapped span as IScopeManager is a completely separate // concept that just happens to sit on ITracer (for easier accessibility). IScope scope = _scopeManager.Activate(span, finishSpanOnDispose); if (span is SpanDecorator decoratedSpan) { _hooks.OnSpanActivated(span, decoratedSpan._operationName); } return(scope); }
/// <summary> /// Make a span the active span and return its new scope. /// </summary> /// <param name="span">The span to activate.</param> /// <param name="finishOnClose">Determines whether closing the returned scope will also finish the span.</param> /// <returns>A Scope object wrapping this span.</returns> public Scope ActivateSpan(Span span, bool finishOnClose = true) { return(_scopeManager.Activate(span, finishOnClose)); }
public IDisposable Activate() => _scopeManager.Activate(this);