FastMediatR.Telemetry
0.1.0
dotnet add package FastMediatR.Telemetry --version 0.1.0
NuGet\Install-Package FastMediatR.Telemetry -Version 0.1.0
<PackageReference Include="FastMediatR.Telemetry" Version="0.1.0" />
<PackageVersion Include="FastMediatR.Telemetry" Version="0.1.0" />
<PackageReference Include="FastMediatR.Telemetry" />
paket add FastMediatR.Telemetry --version 0.1.0
#r "nuget: FastMediatR.Telemetry, 0.1.0"
#:package FastMediatR.Telemetry@0.1.0
#addin nuget:?package=FastMediatR.Telemetry&version=0.1.0
#tool nuget:?package=FastMediatR.Telemetry&version=0.1.0
FastMediatR
High-performance, AOT-friendly, MIT-licensed in-process mediator for .NET 10 with a public API that is a near drop-in replacement for MediatR.
FastMediatR uses a Roslyn IIncrementalGenerator to emit zero-reflection dispatch code at compile time. The result: faster Send/Publish, fewer allocations, and full Native-AOT/trimming compatibility.
Status: Pre-1.0 — actively under construction. Public APIs may shift until v1.0.0 is tagged.
Features
- Zero-reflection dispatch — a source generator emits a
switch-based dispatcher at compile time; noMethodInfo, nodynamic, no runtime type scanning on the hot path. - Native AOT & trimming friendly — ships
IsAotCompatible=trueandIsTrimmable=true; the only reflection touchpoint is a one-time startup lookup that has a fully trim-safe alternative. - Near drop-in for MediatR —
IRequest<T>,IRequestHandler<,>,INotification,INotificationHandler<>,ISender,IPublisher,IMediator, andIPipelineBehavior<,>mirror the MediatR surface (see the migration guide). - Build-time wiring validation — diagnostics
FM001(no handler) andFM002(duplicate handler) fail the build before you run;FM003flags non-default handler lifetimes. - Built-in pipeline behaviors —
ValidationBehavior(FluentValidation),LoggingBehavior, andPerformanceBehavior, plus pre-/post-processors. - Configurable notification publishing —
TaskWhenAllPublisher(default, concurrent) andSequentialAwaitPublisher(ordered, fail-fast). - Optional OpenTelemetry tracing via the
FastMediatR.Telemetrypackage.
Quick start
Define requests and handlers:
using FastMediatR;
public sealed record CreateUserCommand(string Email, string DisplayName) : IRequest<Guid>;
public sealed class CreateUserCommandHandler : IRequestHandler<CreateUserCommand, Guid>
{
public Task<Guid> Handle(CreateUserCommand request, CancellationToken cancellationToken)
=> Task.FromResult(Guid.NewGuid());
}
Register in Program.cs and dispatch:
using FastMediatR.Extensions.DI;
builder.Services.AddFastMediatR<Program>();
app.MapPost("/users", async (CreateUserCommand command, IMediator mediator, CancellationToken ct) =>
{
var id = await mediator.Send(command, ct);
return Results.Created($"/users/{id}", new { id });
});
See the usage guide for DI options, pipeline behaviors, AOT guidance, and MediatR migration.
Project layout
| Project | Purpose |
|---|---|
src/FastMediatR.Core |
Core abstractions, built-in behaviors, notification publishers, options. |
src/FastMediatR.Generator |
Roslyn incremental generator (dispatcher + DI registration). |
src/FastMediatR.Extensions.DI |
AddFastMediatR<TMarker>() entry point and assembly scanning. |
src/FastMediatR.Telemetry |
Optional OpenTelemetry tracing behavior. |
samples/FastMediatR.Sample.Api |
Reference minimal-API sample wired end-to-end. |
Quick links
- Design specification: docs/260524_1200-fastmediatr-design.md
- Implementation task breakdown: docs/260524_1230-fastmediatr-task-breakdown.md
- Usage guide (living): docs/260524_1300-fastmediatr-usage-guide.md
- Testing guide: docs/260529_1230-fastmediatr-testing-guide.md
- Security & performance review: docs/260529_1200-security-performance-review.md
- Reference sample app:
samples/FastMediatR.Sample.Api - .NET / C# coding standards: docs/DotNet.md
Build
dotnet build FastMediatR.slnx
dotnet test FastMediatR.slnx
Requires the .NET 10 SDK (see global.json).
The canonical solution file is FastMediatR.slnx.
License
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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
- FastMediatR.Core (>= 0.1.0)
- FluentValidation (>= 11.11.0)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.0)
- Microsoft.Extensions.DependencyInjection (>= 10.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.0)
- Microsoft.Extensions.Options (>= 10.0.0)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 10.0.0)
- OpenTelemetry (>= 1.15.3)
- OpenTelemetry.Api (>= 1.15.3)
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.1.0 | 42 | 5/29/2026 |