ZipLogger.Metrics.AspNetCore
0.6.0
dotnet add package ZipLogger.Metrics.AspNetCore --version 0.6.0
NuGet\Install-Package ZipLogger.Metrics.AspNetCore -Version 0.6.0
<PackageReference Include="ZipLogger.Metrics.AspNetCore" Version="0.6.0" />
<PackageVersion Include="ZipLogger.Metrics.AspNetCore" Version="0.6.0" />
<PackageReference Include="ZipLogger.Metrics.AspNetCore" />
paket add ZipLogger.Metrics.AspNetCore --version 0.6.0
#r "nuget: ZipLogger.Metrics.AspNetCore, 0.6.0"
#:package ZipLogger.Metrics.AspNetCore@0.6.0
#addin nuget:?package=ZipLogger.Metrics.AspNetCore&version=0.6.0
#tool nuget:?package=ZipLogger.Metrics.AspNetCore&version=0.6.0
ZipLogger.Metrics.AspNetCore
Request metrics (APM) for ASP.NET Core apps on ZipLogger: a middleware that times every request and ships it to your workspace, powering the Metrics page's avg/p95 latency and throughput series per service.
// Program.cs
builder.Services.AddZipLoggerMetrics(builder.Configuration, service: "orders-api");
var app = builder.Build();
app.UseZipLoggerMetrics(); // early, so timings cover the whole pipeline
Configuration (reuses your existing ZipLogger settings — apps already shipping logs need nothing new):
{
"ZipLogger": {
"Endpoint": "https://app.ziplogger.ai",
"ApiKey": "zk_..."
}
}
Optional overrides under ZipLogger:Metrics (Service, MetricName, ExcludePaths,
QueueCapacity, BatchSize, FlushInterval, …). When endpoint/key are unset the middleware is a
no-op, so local runs work without an account.
Sessions across services
The browser SDK's instrumentFetch() sends the
user's session id as W3C baggage (session.id=…) beside traceparent. UseZipLoggerMetrics()
copies it onto the request's Activity as the OpenTelemetry session.id attribute — and as
Activity baggage, so it flows on to the services this one calls — which is what lets ZipLogger's
investigation view show every trace of a session, not only the one request. Nothing is set when
the header is absent. Allow the header in CORS for cross-origin APIs:
Access-Control-Allow-Headers: traceparent, baggage.
Background jobs (workers)
Non-HTTP hosts get the same treatment via ZipLoggerMetrics — time a job run and it ships as
job.duration with the job name as a label:
// worker host: same registration, no middleware needed
builder.Services.AddZipLoggerMetrics(builder.Configuration, service: "orders-workers");
// in a BackgroundService (inject ZipLoggerMetrics)
using (metrics.TimeJob("nightly-sweep"))
{
await RunSweepAsync(ct);
}
Behavior
Same delivery semantics as every ZipLogger client: enqueuing never blocks a request and never
throws. Timings buffer in a bounded queue (default 10,000; drop-over-grow with a
DroppedCount), ship as batches (default 100 / 2 s linger) to /ingest/v1/metrics, retry
transient failures (429 honoring Retry-After, 5xx, network) with exponential backoff, and flush
on graceful shutdown. Each event carries method, route (the route pattern, keeping label
cardinality low), and status labels.
Need a ZipLogger server? Sign up free at ziplogger.ai — the free tier covers 1,000 logs/day. Full documentation: ziplogger.ai/docs.html
| 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 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
- No dependencies.
-
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.
Package metadata only: added the ZipLogger icon, pointed the project link at https://ziplogger.ai/, and refreshed the README links. No API or behavior changes.