Seq client integration
Dette indhold er ikke tilgængeligt i dit sprog endnu.
To get started with the Seq client integration, install the 📦 Aspire.Seq NuGet package in the client-consuming project:
dotnet add package Aspire.Seq#:package Aspire.Seq@*<PackageReference Include="Aspire.Seq" Version="*" />Add a Seq client
Section titled “Add a Seq client”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");Connection properties
Section titled “Connection properties”When you reference a Seq resource using WithReference, the following connection properties are made available to the consuming project:
The Seq resource exposes the following connection properties:
| Property Name | Description |
|---|---|
Host | The hostname or IP address of the Seq server |
Port | The port number the Seq server is listening on |
Uri | The connection URI, with the format http://{Host}:{Port} |
Example connection string:
Uri: http://localhost:5341Configuration
Section titled “Configuration”The Seq integration provides multiple options to configure the connection to Seq.
Use configuration providers
Section titled “Use configuration providers”The Seq integration supports Microsoft.Extensions.Configuration. It loads the SeqSettings from configuration using the Aspire:Seq key. Example appsettings.json:
{ "Aspire": { "Seq": { "DisableHealthChecks": true, "ServerUrl": "http://localhost:5341" } }}Use named configuration
Section titled “Use named configuration”The Seq integration supports named configuration for multiple instances:
{ "Aspire": { "Seq": { "seq1": { "ServerUrl": "http://seq1:5341", "DisableHealthChecks": true }, "seq2": { "ServerUrl": "http://seq2:5341", "DisableHealthChecks": false } } }}Use the connection names when calling AddSeqEndpoint:
builder.AddSeqEndpoint("seq1");builder.AddSeqEndpoint("seq2");Use inline delegates
Section titled “Use inline delegates”You can pass the Action<SeqSettings> delegate to set up options inline:
builder.AddSeqEndpoint("seq", static settings =>{ settings.DisableHealthChecks = true; settings.ServerUrl = "http://localhost:5341";});Client integration health checks
Section titled “Client integration health checks”By default, Aspire integrations enable health checks for all services. The Seq integration:
- Adds the health check when
DisableHealthChecksisfalse, which attempts to connect to the Seq server’s/healthendpoint. - Integrates with the
/healthHTTP endpoint.
Observability and telemetry
Section titled “Observability and telemetry”Logging
Section titled “Logging”The Seq integration uses the following log categories:
Seq
Tracing and Metrics
Section titled “Tracing and Metrics”The Seq integration doesn’t emit tracing activities or metrics because it’s a telemetry sink, not a telemetry source.