Shared diagnostics client, contracts, and fire-and-forget forwarding service for CodeTorch and integrated applications.
License
—
Deps
4
Install Size
—
Vulns
✓ 0
Published
Feb 18, 2026
$ dotnet add package CodeTorch.Diagnostics.SDKCodeTorch.Diagnostics is a lightweight .NET diagnostics forwarding package used by
CodeTorch-integrated applications to send session-scoped frontend/backend diagnostic
payloads to a hosted receiver.
Add package references in your API project:
<PackageReference Include="CodeTorch.Diagnostics.SDK" Version="0.1.0" />
Register the client in Program.cs:
builder.Services.AddCodeTorchDiagnostics(builder.Configuration);
Then resolve IDiagnosticsForwarder where needed:
var sessionId = await forwarder.CreateSessionAsync(new DiagnosticSessionCreateRequest
{
SourceSystem = "MyApp",
SourceEnvironment = "dev"
});
forwarder.QueueEvent(sessionId.Value, new DiagnosticEvent
{
Source = "frontend",
Type = "log",
Level = "info",
Message = "Button clicked"
});
"CodeTorchDiagnostics": {
"Enabled": true,
"ReceiverBaseUrl": "https://portal-api.my-org.com",
"SessionsRoute": "api/diagnostics/sessions",
"ApiKey": "...optional...",
"ApiKeyHeaderName": "X-Codetorch-ApiKey"
}
Set Enabled to false to keep all calls no-op.