TailoredApps.Shared.WebApi 1.4.10

dotnet add package TailoredApps.Shared.WebApi --version 1.4.10
                    
NuGet\Install-Package TailoredApps.Shared.WebApi -Version 1.4.10
                    
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="TailoredApps.Shared.WebApi" Version="1.4.10" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="TailoredApps.Shared.WebApi" Version="1.4.10" />
                    
Directory.Packages.props
<PackageReference Include="TailoredApps.Shared.WebApi" />
                    
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 TailoredApps.Shared.WebApi --version 1.4.10
                    
#r "nuget: TailoredApps.Shared.WebApi, 1.4.10"
                    
#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 TailoredApps.Shared.WebApi@1.4.10
                    
#: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=TailoredApps.Shared.WebApi&version=1.4.10
                    
Install as a Cake Addin
#tool nuget:?package=TailoredApps.Shared.WebApi&version=1.4.10
                    
Install as a Cake Tool

TailoredApps.Shared.WebApi

Production-ready defaults for ASP.NET Core Web APIs, wired through a single call. Add this package to every service and get consistent observability, health probing and outbound-call resilience without copy-pasting boilerplate into each Program.cs.

What you get

Concern What is configured
Metrics OpenTelemetry metrics for ASP.NET Core, HttpClient and the .NET runtime (GC, thread pool, exceptions).
Tracing OpenTelemetry distributed tracing for ASP.NET Core and HttpClient; health-probe requests are filtered out.
Logging OpenTelemetry logging with formatted messages and scopes.
Export OTLP exporter for all three signals, enabled when an endpoint is configured.
Health checks Readiness (/health, all checks) and liveness (/alive, live-tagged checks) endpoints with a JSON writer.
HTTP clients Standard resilience handler (retry, circuit breaker, timeouts) and service discovery on every client.

Usage

var builder = WebApplication.CreateBuilder(args);

builder.AddTailoredWebApiDefaults();

var app = builder.Build();

app.MapTailoredWebApiDefaults(); // maps /health and /alive
app.Run();

Configuration

Everything can be driven from the WebApiDefaults configuration section:

{
  "WebApiDefaults": {
    "ServiceName": "catalog-api",
    "ServiceVersion": "1.4.0",
    "HealthChecks": {
      "ReadinessPath": "/health",
      "LivenessPath": "/alive",
      "AllowDetailedResponse": false
    },
    "Observability": {
      "EnableTracing": true,
      "EnableMetrics": true,
      "EnableLogging": true,
      "OtlpExporterEndpoint": "http://otel-collector:4317"
    },
    "HttpClient": {
      "EnableStandardResilience": true,
      "EnableServiceDiscovery": true
    }
  }
}

The OTLP endpoint also honours the standard OTEL_EXPORTER_OTLP_ENDPOINT environment variable. When no endpoint is resolved, telemetry is still collected in-process but not exported.

Overriding in code

Code overrides are applied after configuration binding:

builder.AddTailoredWebApiDefaults(options =>
{
    options.ServiceName = "catalog-api";
    options.HealthChecks.AllowDetailedResponse = builder.Environment.IsDevelopment();
});

Adding a Prometheus /metrics endpoint

The default export path is OTLP (push to an OpenTelemetry Collector, which can expose Prometheus). If you want an in-process Prometheus scrape endpoint instead, add the OpenTelemetry.Exporter.Prometheus.AspNetCore package and use the metrics hook:

builder.AddTailoredWebApiDefaults(options =>
{
    options.Observability.ConfigureMetrics = metrics => metrics.AddPrometheusExporter();
});

var app = builder.Build();
app.MapTailoredWebApiDefaults();
app.MapPrometheusScrapingEndpoint(); // /metrics

Target frameworks

net8.0, net9.0, net10.0.

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 is compatible.  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.

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
1.4.10 182 7/8/2026
1.4.9 98 7/8/2026