Beispiel #1
0
        public Error(CapturedException capturedException, Transaction transaction, string parentId, IApmLogger loggerArg, Dictionary <string, Label> labels = null)
        {
            Timestamp = TimeUtils.TimestampNow();
            Id        = RandomGenerator.GenerateRandomBytesAsString(new byte[16]);

            Exception = capturedException;

            TraceId       = transaction.TraceId;
            TransactionId = transaction.Id;
            ParentId      = parentId;
            Transaction   = new TransactionData(transaction.IsSampled, transaction.Type);

            if (transaction.IsSampled)
            {
                Context = transaction.Context.DeepCopy();

                if (labels != null)
                {
                    foreach (var item in labels)
                    {
                        Context.InternalLabels.Value.InnerDictionary[item.Key] = item.Value;
                    }
                }
            }

            IApmLogger logger = loggerArg?.Scoped($"{nameof(Error)}.{Id}");

            logger.Trace()
            ?.Log("New Error instance created: {Error}. Time: {Time} (as timestamp: {Timestamp})",
                  this, TimeUtils.FormatTimestampForLog(Timestamp), Timestamp);
        }
 public Error(CapturedException capturedException, Transaction transaction, string parentId)
     : this(capturedException)
 {
     TraceId       = transaction.TraceId;
     TransactionId = transaction.Id;
     ParentId      = parentId;
     Transaction   = new TransactionData(transaction.IsSampled, transaction.Type);
 }
        private Error(CapturedException capturedException)
        {
            _start = DateTimeOffset.UtcNow;
            var idBytes = new byte[8];

            RandomGenerator.GenerateRandomBytes(idBytes);
            Id = BitConverter.ToString(idBytes).Replace("-", "");

            Exception = capturedException;
        }
Beispiel #4
0
 private Error(string culprit, CapturedException capturedException, string id, string parentId, long timestamp, string traceId,
               string transactionId, TransactionData transaction
               )
 {
     Culprit       = culprit;
     Exception     = capturedException;
     Id            = id;
     ParentId      = parentId;
     Timestamp     = timestamp;
     TraceId       = traceId;
     TransactionId = transactionId;
     Transaction   = transaction;
 }
Beispiel #5
0
        public Error(CapturedException capturedException, Transaction transaction, string parentId, IApmLogger loggerArg)
        {
            Timestamp = TimeUtils.TimestampNow();
            Id        = RandomGenerator.GenerateRandomBytesAsString(new byte[16]);

            Exception = capturedException;

            TraceId       = transaction.TraceId;
            TransactionId = transaction.Id;
            ParentId      = parentId;
            Transaction   = new TransactionData(transaction.IsSampled, transaction.Type);

            IApmLogger logger = loggerArg?.Scoped($"{nameof(Error)}.{Id}");

            logger.Trace()
            ?.Log("New Error instance created: {Error}. Time: {Time} (as timestamp: {Timestamp})",
                  this, TimeUtils.FormatTimestampForLog(Timestamp), Timestamp);
        }
Beispiel #6
0
 public Error(CapturedException capturedException, Transaction transaction, string parentId, IApmLogger loggerArg,
              Dictionary <string, Label> labels = null
              )
     : this(transaction, parentId, loggerArg, labels) => Exception = capturedException;
Beispiel #7
0
 private Error(CapturedException capturedException)
 {
     _start    = DateTimeOffset.UtcNow;
     Id        = RandomGenerator.GenerateRandomBytesAsString(new byte[16]);
     Exception = capturedException;
 }