public static void ExecuteTryMethodInScopeAndLogFailures( this ISpanBuilder spanBuilder, TryMethodDelegate action) { using (IScope scope = spanBuilder.StartActive()) { action(out bool failed); if (failed) { scope.Span.SetTag(KnownTagNames.Error, true); } } }
public static T ExecuteTryMethodInScopeAndLogFailures <T>( this ISpanBuilder spanBuilder, TryMethodDelegate <T> action) { using (IScope scope = spanBuilder.StartActive()) { var result = action(out bool failed); if (failed) { scope.Span.SetTag(KnownTagNames.Error, true); } return(result); } }