public bool Process(ErrorEventPacket errorEventPacket) { foreach (var filter in _contentFilters.OrderBy(x => x.Order)) { errorEventPacket.ErrorEventEntity = filter.FilterContents(errorEventPacket.ErrorEventEntity); } return _nextStage.Process(errorEventPacket); }
public bool Process(ErrorEventPacket errorEventPacket) { errorEventPacket.ErrorEventEntity.Fingerprint = FingerprintGenerator.ComputeFingerprint(errorEventPacket.ErrorEventEntity); if (_nextStage == null) return true; return _nextStage.Process(errorEventPacket); }
public bool Process(ErrorEventPacket errorEventPacket) { if (ShouldRejectEvent(errorEventPacket.InputLogEvent)) { Reject(errorEventPacket.InputLogEvent); return true; } return _nextStage.Process(errorEventPacket); }
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; }
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; } }
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); }
public bool Process(ErrorEventPacket errorEventPacket) { return _persisterDaemon.TryAddEvent(errorEventPacket); }
private void AddToPendingEvents(ErrorEventPacket eventPacket) { var split = SplitEventPacket(eventPacket); AddToDefinitions(split.Item1); AddToInstances(split.Item2); }
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; }
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); }
private bool Ingest(InputLogEvent inputLogEvent) { var errorEventPacket = new ErrorEventPacket(inputLogEvent); return _firstPipelineStage.Process(errorEventPacket); }