Zzdats.Audit.Sdk
10.0.3
Prefix Reserved
dotnet add package Zzdats.Audit.Sdk --version 10.0.3
NuGet\Install-Package Zzdats.Audit.Sdk -Version 10.0.3
<PackageReference Include="Zzdats.Audit.Sdk" Version="10.0.3" />
<PackageVersion Include="Zzdats.Audit.Sdk" Version="10.0.3" />
<PackageReference Include="Zzdats.Audit.Sdk" />
paket add Zzdats.Audit.Sdk --version 10.0.3
#r "nuget: Zzdats.Audit.Sdk, 10.0.3"
#:package Zzdats.Audit.Sdk@10.0.3
#addin nuget:?package=Zzdats.Audit.Sdk&version=10.0.3
#tool nuget:?package=Zzdats.Audit.Sdk&version=10.0.3
Audit SDK
Integrate the Audit API into your C# project!
Audit providers
The preceding code shows the Startup class.
public class Startup
{
public Startup(IConfiguration configuration)
{
Configuration = configuration;
}
public IConfiguration Configuration { get; }
public void ConfigureServices(IServiceCollection services)
{
services.AddAudit(Configuration.GetSection("Lgp:Audit"));
}
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
app.UseAudit();
}
...
}
Configure audit
Audit configuration is commonly provided by the audit section of appsettings.{Environment}.json files.
{
...
"Lgp": {
"Application": {
"Id": 190
},
"Infrastructure": {
"Authority": {
"Url": "<authority_url>",
"ClientId": "<authority_clientId>",
"ClientSecret": "<authority_clientSecret>"
},
"Csso": {
"Url": "<csso_url>"
},
"Service": {
"Code": "AUDIT"
},
"Health": {
"Enabled": true
}
},
"Audit": {
"Url": "<audit_url>",
"ClientId": "<audit_clientId>",
"ClientSecret": "<audit_clientSecret>"
}
}
}
Resilience configuration
Each audit HTTP client (BusinessEventProvider, PersonProcessEventProvider, ClassifierProvider, etc.)
has its own resilience pipeline (retry, timeouts): it retries transient failures and bounds how long a
call may block, but never fails fast, since an audit call must succeed before the calling operation can continue.
Defaults apply out of the box; override any setting via a Resilience section. To limit how long a
request can block during an audit outage, lower TotalTimeout (and AttemptTimeout accordingly):
{
"Lgp": {
"Audit": {
"Url": "<audit_url>",
"ClientId": "<audit_clientId>",
"ClientSecret": "<audit_clientSecret>",
"Resilience": {
"MaxRetryAttempts": 2,
"RetryBaseDelay": "00:00:02",
"AttemptTimeout": "00:00:10",
"TotalTimeout": "00:00:45"
}
}
}
}
In a Docker/environment-variable setup, nested sections use __ instead of :, e.g.
Lgp__Audit__Resilience__TotalTimeout=00:00:45.
| Setting | Default | Description |
|---|---|---|
MaxRetryAttempts |
2 |
Retries for transient failures. |
RetryBaseDelay |
2s |
Base delay between retries (exponential backoff + jitter). |
AttemptTimeout |
10s |
Timeout per HTTP attempt. |
TotalTimeout |
45s |
Overall timeout across all attempts. |
Config changes apply live, no restart needed.
For full control (e.g. custom retry predicates), build the HTTP clients yourself instead of calling
AddAudit/AddAuditUsingSession, using AuditDefaults.ConfigureResiliencePipeline(builder, options)
as a starting point.
Error handling
Audit provider calls can throw:
AuditApiException— either the audit API returned a validation problem (HTTP 400, in which caseApiProblemDetailsis populated), or the call timed out (AttemptTimeout/TotalTimeoutexceeded, in which caseApiProblemDetailsisnullandInnerExceptionis aPolly.Timeout.TimeoutRejectedException).HttpRequestException— a non-success response other than validation errors, including transient failures once retries configured viaResilienceare exhausted.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- IdentityModel (>= 7.0.0)
- Microsoft.AspNetCore.HeaderPropagation (>= 10.0.11)
- Microsoft.Extensions.DependencyInjection (>= 10.0.11)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.11)
- Microsoft.Extensions.Http (>= 10.0.11)
- Microsoft.Extensions.Http.Resilience (>= 10.9.0)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 10.0.11)
- Zzdats.Lgp.Common.Core (>= 10.0.10)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.