Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/eventlog-design.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## What it is

The event log is the primary instance's activity feed: the chronological "what has this instance noticed" list that ServicePulse shows. Message failures, retries, redirects, heartbeats, custom checks and integration failures all surface here.
The event log is the primary instance's activity feed: the chronological "what has this instance noticed" list that ServicePulse shows. Retries, redirects, heartbeats, custom checks and integration failures all surface here. Message failures do not: they are visible on the failed messages screen instead, and recording one row per failure in the feed was removed as write and retention overhead on the hot ingest path.

It is a **projection of domain events, not a log file**. Nothing writes to it directly. Components raise domain events for their own reasons, and the event log turns a chosen subset of those into feed items. An event only appears if someone has declared how it should read, which makes the feed an editorial selection rather than a dump.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ namespace ServiceControl.AcceptanceTests.Recoverability.MessageFailures
using AcceptanceTesting;
using AcceptanceTesting.EndpointTemplates;
using CompositeViews.Messages;
using EventLog;
using Infrastructure;
using NServiceBus;
using NServiceBus.AcceptanceTesting;
Expand Down Expand Up @@ -169,30 +168,6 @@ public async Task Should_be_listed_in_the_messages_list(CancellationToken cancel
}
}

[Test]
public async Task Should_add_an_event_log_item()
{
EventLogItem entry = null;

var context = await Define<MyContext>()
.WithEndpoint<Receiver>(b => b.When(bus => bus.SendLocal(new MyMessage())).DoNotFailOnErrorMessages())
.Done(async c =>
{
var result = await this.TryGetSingle<EventLogItem>("/api/eventlogitems/", e => e.RelatedTo.Any(r => r.Contains(c.UniqueMessageId)) && e.EventType == nameof(Contracts.MessageFailures.MessageFailed));
entry = result;
return result;
})
.Run();

using (Assert.EnterMultipleScope())
{
Assert.That(entry.Severity, Is.EqualTo(Severity.Error), "Failures should be treated as errors");
Assert.That(entry.Description, Does.Contain("exception"), "For failed messages, the description should contain the exception information");
Assert.That(entry.RelatedTo.Any(item => item == "/message/" + context.UniqueMessageId), Is.True, "Should contain the api url to retrieve additional details about the failed message");
Assert.That(entry.RelatedTo.Any(item => item == "/endpoint/" + context.EndpointNameOfReceivingEndpoint), Is.True, "Should contain the api url to retrieve additional details about the endpoint where the message failed");
}
}

[Test]
public async Task Should_be_able_to_search_queueaddresses()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,6 @@ public async Task Should_ingest_a_failed_message_into_the_shared_database()
Assert.That(knownEndpoints.Select(endpoint => endpoint.Name), Does.Contain("IngestOnly.Receiver"));
}

await WaitFor(host, async dbContext => await dbContext.EventLogItems.AsNoTracking()
.AnyAsync(item => item.EventType == "MessageFailed" && item.Description == "Simulated failure"),
"an event log entry for the failure");

using var client = host.GetTestClient();

var liveness = await client.GetAsync("/health");
Expand Down Expand Up @@ -212,27 +208,6 @@ await infrastructure.Dispatcher.Dispatch(
}
}

static async Task WaitFor(IHost host, Func<ServiceControlDbContext, Task<bool>> condition, string description)
{
var scopeFactory = host.Services.GetRequiredService<IServiceScopeFactory>();
var timeout = Stopwatch.StartNew();

while (timeout.Elapsed < TimeSpan.FromSeconds(60))
{
await using var scope = scopeFactory.CreateAsyncScope();
var dbContext = scope.ServiceProvider.GetRequiredService<ServiceControlDbContext>();

if (await condition(dbContext))
{
return;
}

await Task.Delay(TimeSpan.FromMilliseconds(200));
}

Assert.Fail($"Timed out waiting for {description}.");
}

static async Task<FailedMessageEntity> WaitForFailedMessage(IHost host, string messageId)
{
var scopeFactory = host.Services.GetRequiredService<IServiceScopeFactory>();
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ public override void Configure(Settings settings, ITransportCustomization transp
services.AddEventLogMapping<FailedMessageGroupArchivedDefinition>();
services.AddEventLogMapping<FailedMessageGroupUnarchivedDefinition>();
services.AddEventLogMapping<FailedMessageUnArchivedDefinition>();
services.AddEventLogMapping<MessageFailedDefinition>();
services.AddEventLogMapping<MessageFailedInStagingDefinition>();
services.AddEventLogMapping<MessageFailureResolvedByRetryDefinition>();
services.AddEventLogMapping<MessageFailureResolvedManuallyDefinition>();
Expand Down
Loading