Version v0.1 · dotnet
Events and Event Sinks
Runtime event model and how DurableStack publishes events to sinks.
Events and Event Sinks
DurableStack emits lifecycle and worker events during execution.
Event sinks consume those events for logging, telemetry, and hosted observability ingestion.
Event types
job_claimedjob_startedjob_succeededjob_failedjob_retriedretry_scheduledworker_heartbeat
How sinks are wired
- DurableStack always has a no-op sink by default.
- You can add logging sink with
UseDurableStackLoggingEventSink(). - Hosted ingestion sink is added automatically when both tenant credentials are configured.
Hosted ingestion behavior
- Event sink is enabled only when tenant credentials are configured.
- Events are buffered in a bounded channel.
- Sync service flushes in batches with retry/backoff.
Example
builder.Services.AddDurableStackPostgres(connectionString, options =>
{
options.Eventing.TenantId = "tenant_...";
options.Eventing.ClientSecret = "secret_...";
});
builder.Services.UseDurableStackLoggingEventSink();
Recommended practice
- Configure tenant identity and client secret explicitly.
- Keep environment/service labels consistent.
- Use correlation IDs for cross-system traceability.