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
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ZipLogger.Metrics.AspNetCore" Version="0.6.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ZipLogger.Metrics.AspNetCore" Version="0.6.0" />
                    
Directory.Packages.props
<PackageReference Include="ZipLogger.Metrics.AspNetCore" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ZipLogger.Metrics.AspNetCore --version 0.6.0
                    
#r "nuget: ZipLogger.Metrics.AspNetCore, 0.6.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package ZipLogger.Metrics.AspNetCore@0.6.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ZipLogger.Metrics.AspNetCore&version=0.6.0
                    
Install as a Cake Addin
#tool nuget:?package=ZipLogger.Metrics.AspNetCore&version=0.6.0
                    
Install as a Cake Tool

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • 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.

Version Downloads Last Updated
0.6.0 106 9/20/2026
0.5.0 122 8/30/2026
0.3.3 116 8/22/2026
0.3.2 121 8/18/2026
0.3.1 111 8/18/2026
0.3.0 108 8/18/2026
0.1.0 107 8/18/2026

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.