示例#1
0
        public bool Process(ErrorEventPacket errorEventPacket)
        {
            foreach (var filter in _contentFilters.OrderBy(x => x.Order))
            {
                errorEventPacket.ErrorEventEntity = filter.FilterContents(errorEventPacket.ErrorEventEntity);
            }

            return _nextStage.Process(errorEventPacket);
        }
示例#2
0
        public bool Process(ErrorEventPacket errorEventPacket)
        {
            errorEventPacket.ErrorEventEntity.Fingerprint = FingerprintGenerator.ComputeFingerprint(errorEventPacket.ErrorEventEntity);

            if (_nextStage == null)
                return true;

            return _nextStage.Process(errorEventPacket);
        }
示例#3
0
 public bool Process(ErrorEventPacket errorEventPacket)
 {
     if (ShouldRejectEvent(errorEventPacket.InputLogEvent))
     {
         Reject(errorEventPacket.InputLogEvent);
         return true;
     }
     
     return _nextStage.Process(errorEventPacket);
 }
示例#4
0
        public bool TryAddEvent(ErrorEventPacket eventPacket)
        {
            if (_stopRequested)
                throw new IngestionException("Cannot accept event because stop has been requested");

            if (_persistQueue.Count > _configuration.MaxPersistenceQueueSize)
                return false;

            AddToPendingEvents(eventPacket);
            
            return true;
        }
示例#5
0
 public bool Process(ErrorEventPacket errorEventPacket)
 {
     try
     {
         errorEventPacket.ErrorEventEntity = _errorParser.Parse(errorEventPacket.InputLogEvent);
         return _nextStage.Process(errorEventPacket);
     }
     catch (Exception ex)
     {
         // log it
         _eventDiscarder.DiscardAsync(errorEventPacket.InputLogEvent, DiscardReason.ParserFailure);
         return false;
     }
 }
示例#6
0
        public async Task<bool> TryIngestAsync(IList<InputLogEvent> inputLogEvents)
        {
            var eventPackets = new List<ErrorEventPacket>();

            foreach (var inputLogEvent in inputLogEvents)
            {
                var eventPacket = new ErrorEventPacket(inputLogEvent);
                var result = _firstPipelineStage.Process(eventPacket);
                if (!result)
                    return false;

                eventPackets.Add(eventPacket);
            }

            var errorEvents = eventPackets.Select(x => x.ErrorEventEntity).ToList();
            return await PersistAsync(errorEvents);
        }
示例#7
0
 public bool Process(ErrorEventPacket errorEventPacket)
 {
     return _persisterDaemon.TryAddEvent(errorEventPacket);
 }
示例#8
0
 private void AddToPendingEvents(ErrorEventPacket eventPacket)
 {
     var split = SplitEventPacket(eventPacket);
     AddToDefinitions(split.Item1);
     AddToInstances(split.Item2);
 }
示例#9
0
        private ErrorEventPacket RecombineEventPacket(ErrorDefinitionEntity errorDefinition, ErrorInstanceEntity errorInstance)
        {
            var inputLogEvent = new InputLogEvent();
            inputLogEvent.Message = errorDefinition.MessageSource;

            var errorEvent = new ErrorEventEntity();
            errorEvent.Application = errorDefinition.Application;
            errorEvent.ApplicationDateTime = errorInstance.ApplicationDateTime;
            errorEvent.Exceptions = RecombineExceptions(errorDefinition.Exceptions, errorInstance.Exceptions);
            errorEvent.Fingerprint = errorDefinition.Fingerprint;
            errorEvent.MessageSource = errorDefinition.MessageSource;
            errorEvent.Server = GetFromServerCache(errorInstance.ServerCacheId);

            var eventPacket = new ErrorEventPacket(inputLogEvent);
            eventPacket.ErrorEventEntity = errorEvent;

            return eventPacket;
        }
示例#10
0
        private Tuple<ErrorDefinitionEntity, ErrorInstanceEntity> SplitEventPacket(ErrorEventPacket eventPacket)
        {
            var errorDefinition = new ErrorDefinitionEntity();
            errorDefinition.Application = eventPacket.ErrorEventEntity.Application;
            errorDefinition.Exceptions = eventPacket.ErrorEventEntity.Exceptions.Select(x => new ExceptionDefinitionEntity()
            {
                Depth = x.Depth,
                ExceptionType = x.ExceptionType,
                StackFrames = x.StackFrames,
            }).ToList();
            errorDefinition.Fingerprint = eventPacket.ErrorEventEntity.Fingerprint;
            errorDefinition.MessageSource = eventPacket.ErrorEventEntity.MessageSource;

            var errorInstance = new ErrorInstanceEntity();
            errorInstance.ApplicationDateTime = eventPacket.ErrorEventEntity.ApplicationDateTime;
            errorInstance.FingerprintCacheId = AddToFingerprintCache(eventPacket.ErrorEventEntity.Fingerprint);
            errorInstance.ServerCacheId = AddToServerCache(eventPacket.ErrorEventEntity.Server);
            errorInstance.Exceptions = eventPacket.ErrorEventEntity.Exceptions.Select(x => new ExceptionInstanceEntity()
            {
                Depth = x.Depth,
                MessageCacheId = AddToMessageCache(x.Message)
            }).ToList();

            errorInstance.PersistenceAttempts = (short)eventPacket.PersistenceAttempts;

            return new Tuple<ErrorDefinitionEntity, ErrorInstanceEntity>(errorDefinition, errorInstance);
        }
示例#11
0
 private bool Ingest(InputLogEvent inputLogEvent)
 {
     var errorEventPacket = new ErrorEventPacket(inputLogEvent);
     return _firstPipelineStage.Process(errorEventPacket);
 }