Get started with the Seq integration
Seq is the intelligent search, analysis, and alerting server built for structured log data. The Aspire Seq integration enables you to connect to existing Seq instances or create new instances from Aspire with the datalust/seq container image.
In this introduction, you'll see how to install and use the Aspire Seq integrations in a simple configuration. If you already have this knowledge, see Seq hosting integration for full reference details.
Note
To follow this guide, you must have created an Aspire solution to work with. To learn how to do that, see Build your first Aspire app.
Set up hosting integration
To begin, install the Aspire Seq hosting integration in your Aspire AppHost project:
dotnet add package Aspire.Hosting.SeqNext, in the AppHost project, create instances of Seq resources and pass them to the consuming client projects:
var builder = DistributedApplication.CreateBuilder(args);
var seq = builder.AddSeq("seq")
.ExcludeFromManifest()
.WithLifetime(ContainerLifetime.Persistent)
.WithEnvironment("ACCEPT_EULA", "Y");
var myService = builder.AddProject<Projects.ExampleProject>()
.WithReference(seq)
.WaitFor(seq);
builder.Build().Run();
Note
The Seq container may be slow to start, so it's best to use a persistent lifetime to avoid unnecessary restarts. For more information, see Container resource lifetime.
Note
You must accept the Seq EULA for Seq to start. To accept the agreement in code, pass the environment variable ACCEPT_EULA to the Seq container, and set its value to Y.
Set up client integration
To get started with the Seq client integration, install the package:
dotnet add package Aspire.SeqIn the Program.cs file of your client-consuming project, call the AddSeqEndpoint extension method to register OpenTelemetry Protocol exporters to send logs and traces to Seq:
builder.AddSeqEndpoint(connectionName: "seq");
Tip
The connectionName parameter must match the name used when adding the Seq
resource in the AppHost project.