コンテンツにスキップ

Get started with the Seq integration

このコンテンツはまだ日本語訳がありません。

Seq logo

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.

To begin, install the Aspire Seq hosting integration in your Aspire AppHost project:

Aspire CLI — Aspire.Hosting.Seq パッケージを追加
aspire add seq

Aspire CLI は対話的です。求められたら適切な結果を選択してください:

Aspire CLI — 出力例
Select an integration to add:
> seq (Aspire.Hosting.Seq)
> Other results listed as selectable options...

Next, in the AppHost project, create instances of Seq resources and pass them to the consuming client projects:

C# — AppHost.cs
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();

To get started with the Seq client integration, install the package:

.NET CLI — Add Aspire.Seq package
dotnet add package Aspire.Seq

In 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");