---
title: Advanced Options
description: Advanced runtime tuning for retention, eventing, and registration behavior.
order: 37
---

# Advanced Options

Advanced options are useful once the baseline runtime is stable and observed under real workload.

## Eventing options

Use these when connecting to hosted observability or tuning ingestion behavior:

- `Eventing.TenantId`
- `Eventing.ClientSecret`
- `Eventing.IngestionApiBaseUrl`
- `Eventing.IngestionPath`
- `Eventing.IngestionMaxBatchSize`
- `Eventing.IngestionMaxRequestBodyBytes`
- `Eventing.IngestionMaxRetryAttempts`
- `Eventing.IngestionFlushIntervalSeconds`
- `Eventing.IncludeErrorDetail`
- `Eventing.MaxErrorDetailLength`

Event ingestion is automatically enabled when both `TenantId` and `ClientSecret` are set.

## Retention options

Use these to control terminal run cleanup behavior:

- `Retention.Enabled`
- `Retention.RunRetentionSeconds`
- `Retention.SweepIntervalSeconds`
- `Retention.DeleteBatchSize`

## Registration options

- `JobRegistration.AutoDiscoverJobsFromAssembly`: auto-discover public job types.
- `Recurring.RegistrationSync.*`: reconcile code definitions with stored recurring records.

## Example

```csharp
builder.Services.AddDurableStackPostgres(connectionString, options =>
{
    options.Eventing.IngestionFlushIntervalSeconds = 5;
    options.Eventing.IncludeErrorDetail = false;

    options.Retention.Enabled = true;
    options.Retention.RunRetentionSeconds = 7 * 24 * 60 * 60;
    options.Retention.SweepIntervalSeconds = 300;
    options.Retention.DeleteBatchSize = 1000;

    options.JobRegistration.AutoDiscoverJobsFromAssembly = true;
});
```

## Guidance

- Change advanced options intentionally and validate impact in staging.
- Keep sensitive settings (tenant/client secret) in secure secret storage.
- Avoid enabling verbose error detail unless required for controlled environments.
