DevLite 0.1.5
dotnet add package DevLite --version 0.1.5
NuGet\Install-Package DevLite -Version 0.1.5
<PackageReference Include="DevLite" Version="0.1.5" />
<PackageVersion Include="DevLite" Version="0.1.5" />
<PackageReference Include="DevLite" />
paket add DevLite --version 0.1.5
#r "nuget: DevLite, 0.1.5"
#:package DevLite@0.1.5
#addin nuget:?package=DevLite&version=0.1.5
#tool nuget:?package=DevLite&version=0.1.5
DevLite .NET SDK
Official .NET SDK for DevLite — AI-powered observability. Mirror of the devlite-java (Maven Central), @devlite/nodejs (npm), devlite (PyPI), and devlite-go SDKs: add two lines, get automatic request tracking, error capture, error grouping, source context, user tracking, and slow-endpoint detection.
Zero third-party dependencies. Requires .NET 8+. ASP.NET Core integration is optional and uses the shared framework.
Install
Add the DevLite package (from NuGet):
dotnet add package DevLite --version 0.1.5
Quickstart
using DevLite;
DevLiteClient.Init("dl_live_xxxxx");
// ... your app ...
That's it. Register the middleware to get automatic request tracking:
// Program.cs
var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();
app.UseMiddleware<DevLiteMiddleware>();
app.Run();
Manual API
// Capture an error (a crash anywhere outside an HTTP request)
DevLiteClient.CaptureError(ex, new Dictionary<string, object?> { ["route"] = "/checkout" });
// Non-error event
DevLiteClient.CaptureMessage("warning", "Payment retried after timeout", new Dictionary<string, object?> { ["attempts"] = 3 });
// Metric (feeds forecasting / anomaly detection)
DevLiteClient.ReportMetric("orders.total", 42.5, "USD", new Dictionary<string, string?> { ["region"] = "eu" });
// Structured log
DevLiteClient.CaptureLog("info", "job finished", new Dictionary<string, object?> { ["job"] = "nightly-backup" });
// Deployment marker (exempt from sampling)
DevLiteClient.ReportDeployment("v2.3.1", "abc123", "scale-out");
// Breadcrumbs attach to the next captured error
DevLiteClient.AddBreadcrumb(new Dictionary<string, object?> { ["type"] = "info", ["message"] = "fetching user" });
// User impact tracking (scoped to the current request) — tags merge into each error's `extra`
DevLiteClient.SetUser(new Dictionary<string, object?> { ["id"] = "u-42", ["email"] = "dev@example.com" });
DevLiteClient.SetTag("region", "lagos");
// Trace span
var span = DevLiteClient.StartSpan("card.charge", new Dictionary<string, object?> { ["paymentMethod"] = "visa" });
// ... work ...
span.End("ok");
Distributed tracing — inbound, zero config
DevLiteMiddleware continues an incoming W3C traceparent header automatically (the header
the Node SDK injects on every outbound call, or any OpenTelemetry-compatible caller). Your
request adopts the caller's traceId, parents into their span (parentId), and honors their
sampling bit — so a request that crosses services shows up as one linked span tree in the
dashboard, not a set of orphaned events.
Node service ──traceparent──▶ .NET service
(injects W3C header) (DevLiteMiddleware continues: same traceId, parentId, sampled)
Requests without a header start a fresh, self-contained trace as before.
Configuration
DevLiteClient.Init(DevLiteConfig.CreateBuilder()
.ApiKey("dl_live_xxxxx")
.ServiceName("checkout-api")
.Environment("production")
.Release("v2.3.1")
.SampleRate(0.25) // coherent sampling: 25% of requests
.CaptureHeaders(true) // includes redacted request headers
.BeforeSend(ev => // run on EVERY event right before enqueue:
{
// mutate to enrich...
ev["runtime"] = "net8";
// ...or return null to drop (e.g. filter health checks)
return ev;
})
.Debug(true)
.Build());
Environment variables are also honored: DEVLITE_API_KEY, DEVLITE_SERVICE_NAME, DEVLITE_ENVIRONMENT, DEVLITE_RELEASE.
What you get automatically
- Every request tracked: method, path, status, duration — plus a
slow_requestevent when it exceeds 1s - W3C distributed tracing — inbound
traceparentheaders are continued automatically, joining your service into the caller's trace BeforeSendhook per event — mutate to enrich, returnnullto drop, safely- Errors captured without being swallowed; fatal uncaught exceptions link to the failing request
- Stable SHA-1 fingerprints so the same bug groups into one issue
- Source code context read live from disk (best-effort, cached)
- Emails, JWTs, bearer tokens, AWS keys, credit card numbers, and sensitive-keyed values redacted before leaving your process
- Bounded queue (max 5000, drop-oldest) and gzip batching to
https://monitoring-devlite.andasy.dev/v1/eventswith exponential-backoff retries - The User-Agent is always
devlite-dotnet/0.1.5so the WAF never blocks telemetry
Building
dotnet test DevLite.sln
dotnet pack src/DevLite/DevLite.csproj -c Release
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. 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. |
-
net8.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.