Ejemplo n.º 1
0
 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);
         }
     }
 }
Ejemplo n.º 2
0
        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);
            }
        }