Exemplo n.º 1
0
        public static void ErrorOccurred(this SegmentSpan span, Exception exception, TracingConfig tracingConfig)
        {
            if (span == null)
            {
                return;
            }

            span.IsError = true;

            if (exception == null)
            {
                return;
            }

            if (tracingConfig == null)
            {
                tracingConfig = new TracingConfig();
            }

            var stackTrace = exception.HasInnerExceptions() ? exception.ToDemystifiedString(tracingConfig.ExceptionMaxDepth) : exception.StackTrace;

            span.AddLog(LogEvent.Event("error"),
                        LogEvent.ErrorKind(exception.GetType().FullName),
                        LogEvent.Message(exception.Message),
                        LogEvent.ErrorStack(stackTrace));
        }
Exemplo n.º 2
0
 public SegmentContext(long traceId, long segmentId, bool sampled, string serviceName, string operationName, SpanType spanType, string identity)
 {
     TraceId     = traceId;
     Sampled     = sampled;
     SegmentId   = segmentId;
     ServiceName = serviceName;
     Identity    = identity;
     Span        = new SegmentSpan(operationName, spanType);
 }
Exemplo n.º 3
0
        public static void ErrorOccurred(this SegmentSpan span)
        {
            if (span == null)
            {
                return;
            }

            span.IsError = true;
        }
Exemplo n.º 4
0
 public SegmentContext(UniqueId traceId, UniqueId segmentId, bool sampled, int serviceId, int serviceInstanceId,
                       string operationName, SpanType spanType)
 {
     TraceId           = traceId;
     Sampled           = sampled;
     SegmentId         = segmentId;
     ServiceId         = serviceId;
     ServiceInstanceId = serviceInstanceId;
     Span = new SegmentSpan(operationName, spanType);
 }
        public static void ErrorOccurred(this SegmentSpan span, Exception exception = null)
        {
            if (span == null)
            {
                return;
            }

            span.IsError = true;
            if (exception != null)
            {
                span.AddLog(LogEvent.Event("error"),
                            LogEvent.ErrorKind(exception.GetType().FullName),
                            LogEvent.Message(exception.Message),
                            LogEvent.ErrorStack(exception.StackTrace));
            }
        }
Exemplo n.º 6
0
 public static void ErrorOccurred(this SegmentSpan span, Exception exception = null)
 {
     span.ErrorOccurred(exception, null);
 }