SinkSharp.Sinks.Dashboard.Redis
1.0.0
dotnet add package SinkSharp.Sinks.Dashboard.Redis --version 1.0.0
NuGet\Install-Package SinkSharp.Sinks.Dashboard.Redis -Version 1.0.0
<PackageReference Include="SinkSharp.Sinks.Dashboard.Redis" Version="1.0.0" />
<PackageVersion Include="SinkSharp.Sinks.Dashboard.Redis" Version="1.0.0" />
<PackageReference Include="SinkSharp.Sinks.Dashboard.Redis" />
paket add SinkSharp.Sinks.Dashboard.Redis --version 1.0.0
#r "nuget: SinkSharp.Sinks.Dashboard.Redis, 1.0.0"
#:package SinkSharp.Sinks.Dashboard.Redis@1.0.0
#addin nuget:?package=SinkSharp.Sinks.Dashboard.Redis&version=1.0.0
#tool nuget:?package=SinkSharp.Sinks.Dashboard.Redis&version=1.0.0
SinkSharp.Sinks.Dashboard.Redis
Redis Streams history for the SinkSharp dashboard.
Every pod appends its events to one Redis Stream. A browser that opens the dashboard on any pod is replayed the recent history of all pods, and that history is still there after a restart, a deployment or a scale-in. "Load older" in the dashboard pages further back through the stream.
It is an optional add-on: the dashboard's in-memory history remains the default, and this package extends it.
Install
dotnet add package SinkSharp.Sinks.Dashboard
dotnet add package SinkSharp.Sinks.Dashboard.Redis
Setup
Multi-pod: live stream + shared history
var redis = builder.Configuration["Redis:ConnectionString"];
builder.Services.AddSinkSharpDashboardRedis(dashSink,
signalR => signalR.AddStackExchangeRedis(redis), // live events across pods (Pub/Sub)
streams => // history across pods and restarts (Streams)
{
streams.ConnectionString = redis;
streams.RetentionDays = 7;
});
app.UseSinkSharpDashboard("/sinksharp/dashboard");
The SignalR backplane needs Microsoft.AspNetCore.SignalR.StackExchangeRedis, as it always has.
Single instance: history that survives restarts
builder.Services.AddSinkSharpDashboard(dashSink);
builder.Services.AddSinkSharpDashboardRedisStreams(o =>
o.ConnectionString = builder.Configuration["Redis:ConnectionString"]);
Worker Service / Console App
await using var history = new RedisStreamHistoryStore(new RedisStreamHistoryOptions
{
ConnectionString = "localhost:6379",
});
var dashboard = new DashboardServer(dashSink, port: 5341) { HistoryStore = history };
await dashboard.StartAsync();
Options
| Property | Default | Description |
|---|---|---|
ConnectionString |
— | StackExchange.Redis connection string. |
Multiplexer |
null |
Reuse an existing IConnectionMultiplexer instead of opening a connection. |
StreamKey |
sinksharp:dashboard:logs |
Everything writing to the same key shares one history. Use one key per environment. |
RetentionDays |
7 |
Events older than this are trimmed (Redis 6.2+ or Valkey). 0 keeps history by count only. |
MaxLength |
100000 |
Maximum number of events kept, whatever their age. Keeps Redis memory predictable. |
BatchSize |
200 |
Events per pipelined write. |
QueueCapacity |
10000 |
Events buffered in memory on their way to Redis. |
TrimInterval |
5 min |
How often age-based trimming runs. |
History is kept until either limit is reached, whichever comes first.
Sizing Redis
An event takes roughly 0.5–1 KB in the stream, so the default cap of 100,000 events is about 50–100 MB.
MaxLength is what keeps Redis memory predictable. Size it to the amount of history you want to keep:
| Events/sec | 100,000 events covers | For 7 days set MaxLength to |
Approx. memory |
|---|---|---|---|
| 1 | ~28 hours | 600,000 | 0.3–0.6 GB |
| 10 | ~2.8 hours | 6,000,000 | 3–6 GB |
| 100 | ~17 minutes | 60,000,000 | 30–60 GB |
To keep more history in the same space, give the dashboard sink its own minimum level, e.g. .WithDashboard(out dashSink, minLevel: LogLevel.Warning).
How it works
- No impact on the logging path. The sink places each event on an in-memory queue and returns; a background task writes pipelined batches to Redis.
- Resilient to Redis interruptions. Logging and the live stream continue. Writes are retried (1 s, 2 s, 4 s), the dashboard serves each pod's own recent events in the meantime, and shared history resumes automatically when Redis is back. Events logged during a longer interruption stay available in each pod's buffer and in your other sinks.
- Burst handling. A bounded queue (
QueueCapacity) absorbs bursts with a fixed memory footprint; under sustained overload the most recent events take priority. - Server-side filtering. Level, text and correlation filters are applied on the server while paging back through the stream, 5,000 events per request; Load older continues from where the last page ended.
- Time order. The dashboard lists events by timestamp, so events from several pods read as one timeline.
- Health and counters.
PingAsync()is a real Redis round-trip backing the dashboard'sGET {dashboard}/healthendpoint andAddSinkSharpDashboardHealthCheck();TotalWritten/TotalDroppedare exposed on/statsand/healthtoo (historyTotalWritten/historyTotalDropped) — see the monitoring section of theSinkSharp.Sinks.DashboardREADME. This only checks the Streams connection — if you also passconfigureSignalR, that backplane is a separate connection owned by ASP.NET Core SignalR and isn't part of this check.
Requirements
SinkSharp.Sinks.Dashboard |
≥ 1.1.0 |
StackExchange.Redis |
≥ 2.8.16 (built and tested against 2.8.16) |
| Redis server | 5.0+ for history and the MaxLength cap; 6.2+ or Valkey for RetentionDays |
Works with any Redis-compatible server that supports Streams. Redis 5.0–6.0 keeps history by MaxLength; Redis 6.2+ and Valkey add age-based retention with RetentionDays.
Release notes
v1.0.0
- Initial release — Redis Streams history store for the SinkSharp dashboard
sinksharp.com · GitHub · Changelog · Apache 2.0
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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 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. |
-
net9.0
- SinkSharp.Sinks.Dashboard (>= 1.1.0)
- StackExchange.Redis (>= 2.8.16)
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.0.0 | 49 | 11/19/2026 |
v1.0.0 — Initial release
• RedisStreamHistoryStore — dashboard history in a Redis Stream, shared by every pod using the same StreamKey
• AddSinkSharpDashboardRedisStreams() — history only; AddSinkSharpDashboardRedis(sink, signalR, streams) — backplane + history in one call
• Non-blocking writes: events are queued and written in pipelined batches on a background task
• Retention by age (RetentionDays, Redis 6.2+/Valkey) and by count (MaxLength, any Redis 5+)
• PingAsync() — a real Redis round-trip with its own short timeout, backing the dashboard's /health endpoint and AddSinkSharpDashboardHealthCheck()
• TotalWritten/TotalDropped now also implement IDashboardHistoryStore's counters, so /stats and /health show them directly
• Resilient to Redis interruptions: logging and the live stream continue, the dashboard serves each pod's recent events, and shared history resumes automatically
• Requires SinkSharp.Sinks.Dashboard 1.1.0 or later
See full changelog: https://github.com/SinkSharp/.github/blob/main/profile/CHANGELOG.md