Fluens.Web.Messaging.Dashboard
0.9.4
dotnet add package Fluens.Web.Messaging.Dashboard --version 0.9.4
NuGet\Install-Package Fluens.Web.Messaging.Dashboard -Version 0.9.4
<PackageReference Include="Fluens.Web.Messaging.Dashboard" Version="0.9.4" />
<PackageVersion Include="Fluens.Web.Messaging.Dashboard" Version="0.9.4" />
<PackageReference Include="Fluens.Web.Messaging.Dashboard" />
paket add Fluens.Web.Messaging.Dashboard --version 0.9.4
#r "nuget: Fluens.Web.Messaging.Dashboard, 0.9.4"
#:package Fluens.Web.Messaging.Dashboard@0.9.4
#addin nuget:?package=Fluens.Web.Messaging.Dashboard&version=0.9.4
#tool nuget:?package=Fluens.Web.Messaging.Dashboard&version=0.9.4
Fluens.Web.Messaging.Dashboard
Cluster-wide live monitoring surface for the Fluens cross-application
messaging mesh. It rolls up the Fluens.Messaging meter instruments
(consume.duration / inbox.lag / retry.count / deadletter.count / delivery.latency) from every
instance into one cluster aggregate, streams it over Server-Sent-Events to a single static dashboard page, and
exposes the per-module dead-letter query + replay surface — all backed by the same Consul the mesh already
runs for discovery and durable subscriptions (ADR 20260530000006). There is no second metrics backend. Without Consul the
dashboard degrades cleanly to a per-instance view.
How it works
Each instance publishes its own StatsSnapshot roll-up into Consul KV; a blocking-query watch aggregates every
live snapshot into a cluster-wide sum (ADR 20260530000006, reusing the ADR 20260529000004 durable-KV + long-poll pattern).
StatsSnapshot— an immutable, additive point-in-time roll-up of theFluens.Messagingmeter instruments for one instance (or, once aggregated, the cluster). The two histograms (consume.duration,delivery.latency) keep both a count and a millisecond total so the cluster mean derives astotal / count; the counters and the inbox-lag scalar add directly.StatsSnapshot.AggregateCluster(clusterId, instances)is a pure per-metric sum — an empty set yields a zeroed snapshot (the local-only view), nevernull. It round-trips AOT-safely via the source-generatedStatsSnapshotSerializerContext.IsLeader(bool?, JSONisLeader) is the process role at build time:truethe instance holds the leader role (alwaystruewithout a lease store),falseit waits,nullon the cluster aggregate — the aggregate never sums it, so two overlapping processes of one replica show as one leader and one waiting instance in the per-instance snapshots.MeterListenerSnapshotSource(IDisposable, internal) — the instance-local snapshot source: a BCLMeterListenerover theFluens.Messagingmeter that accumulates this instance's counters (retry.count,deadletter.count) as running deltas and histograms (consume.duration,delivery.latency) as count + millisecond total.Build()pulls the per-moduleinbox.laggauge viaRecordObservableInstruments()and sums the per-module measurements into oneInboxLag, returning this instance'sStatsSnapshot— the real roll-up the publisher writes to KV. It readsIsLeaderfrom the registeredILeadershipon everyBuild().StatsPublisher(hosted) — publishes this instance's snapshot to the Consul-KV keyfluens/<ClusterId>/messaging/stats/<app>/<instanceId>(<app>= the canonical catalog identityIApplicationIdentity.Key,<instanceId>=IApplicationIdentity.UniqueKey). The key is acquired under a Consul session with a TTL (SessionBehavior.Delete), so a dead instance's snapshot auto-evicts from the cluster aggregate when its session lapses — no explicit cleanup path. Each cycle re-acquires the snapshot under the renewed session (drift repair) and renews the session TTL on the same cadence. A role change is published at once: the publisher publishes on start, on its interval and once more right after every acquisition and every loss of the role, without waiting for the interval, so the storedIsLeaderfollows the role.StatsCatalogWorker(hosted) — a KV blocking-query watch over the cluster stats prefixfluens/<ClusterId>/messaging/stats/. On every index advance — including when a peer's session-TTL-bound key auto-expires — it decodes every per-instance snapshot still present and rebuilds the cluster aggregate via the pureStatsSnapshot.AggregateCluster, atomically swapping it intoCurrent. A stats value that is not validStatsSnapshotJSON is skipped (no log, no counter) and the other snapshots still enter the aggregate.MessagingDashboardEndpoints(IEndpoint) — maps, under the configured route prefix: the staticdashboard.htmlat the prefix root; aGET /streamServer-Sent-Events (text/event-stream) feed that streams the cluster aggregate (first snapshot immediately on connect, then on the configured interval); and the per-module dead-letter query + replay surfaces (ADR 20260530000004 / ADR 20260531000001, registered as keyed services per module):GET /dead-letters?module=&messageType=&failureCode=&partitionKey=&failedAfter=&failedBefore=&limit=→200 DeadLetterSummary[](module absent: every keyedIMessagingMaintenance, mergedFailedAt DESC, Id DESC, then limit; module present: that key only; unknown module or none registered:[])POST /dead-letters/{module}/{id:long}/replay→200 { "replayed": int }(keyedIMessagingRecoveryfor module; unknown module or none registered:0)
Both surfaces are resolved per-request from the keyed registrations — a module that is absent (or an application with no messaging module at all) yields an empty / no-op result rather than failing. The static page carries
data-moduleanddata-idattributes on row buttons for the replay call. The page surfaces the SSE connection state with a coloured indicator next to the status text — amber pulsing while connecting, solid green when live, red pulsing while the browser'sEventSourceis reconnecting.
Local-only graceful degradation
Without an IClusterIdentity or without an IConsulClient in DI (Discovery not registered, or registered
without a cluster id), both stats workers degrade to local-only: the publisher publishes nothing and never
starts a session; the worker runs no KV watch and Current stays the seeded zeroed aggregate. The local-only view
does not show this instance's metrics. Neither throws and messaging is never blocked. The aggregate id streamed by
GET /stream is the IClusterIdentity.ClusterId whenever the identity is in DI (also without an IConsulClient),
otherwise the IApplicationIdentity.Key. The local-snapshot source is read from the Func<StatsSnapshot> in DI, which delegates to the
singleton MeterListenerSnapshotSource roll-up of this instance's Fluens.Messaging meter. The dashboard is
non-load-bearing — it is a live operational glance, not a historical metrics store.
Usage
builder.AddFluens()
.AddWeb()
.AddMessaging()
.AddMessagingMesh(ingress => ingress.UseNpgsql(connectionString))
.AddMessagingDashboard();
var app = builder.Build();
app.MapMessagingMesh();
app.MapMessagingDashboard(); // serves dashboard.html + SSE feed + admin/replay under RoutePrefix
AddMessagingDashboard's Action<MessagingDashboardOptions>? callback is honoured and validated even
with no matching Fluens:Web:Messaging:Dashboard configuration section present.
AddMessagingDashboard registers the hosted StatsPublisher + StatsCatalogWorker and the
MessagingDashboardEndpoints. The cluster comes from the IClusterIdentity in DI, which
AddDiscovery() registers when ClusterId is not blank (the dashboard has no cluster id of its own and does not
read the raw Fluens:Web:Discovery:ClusterId key). It is resolved when the workers are built, so the order of
AddDiscovery() and AddMessagingDashboard() does not matter. The cluster-wide view needs both the identity and
an IConsulClient; without either the dashboard runs local-only. When MessagingDashboardOptions.Enabled is
false, AddMessagingDashboard is a no-op (registers nothing) and MapMessagingDashboard maps no routes —
mirroring the MapFluensHealthchecks "maps nothing when absent" convention.
Configuration
MessagingDashboardOptions is bound from the "Fluens:Web:Messaging:Dashboard" configuration section:
| Property | Default | Description |
|---|---|---|
Enabled |
true |
Master flag; when false the dashboard registers nothing and maps no routes. |
StreamIntervalSeconds |
5 |
Cadence at which the SSE feed pushes the current cluster aggregate (first snapshot is immediate). |
RoutePrefix |
/messaging/dashboard |
Base route the static page, SSE feed, and admin/replay endpoints are mapped under. |
The Consul-KV publish / session-renew cadence (PublishIntervalSeconds, default 10) and the Consul session
TTL (SessionTtlSeconds, default 30 — how long after its last renew a dead instance's key auto-expires) are
read directly from the same "Fluens:Web:Messaging:Dashboard" section. The cluster id comes from
IClusterIdentity (registered by AddDiscovery() from DiscoveryOptions.ClusterId): it is the stats key
namespace and is not a dashboard option.
This package does not declare a
Microsoft.AspNetCore.Appframework reference — it inherits ASP.NET Core transitively viaFluens.Web.
| 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
- Consul (>= 1.8.0)
- Fluens.Messaging (>= 0.9.4)
- Fluens.Web.Api (>= 0.9.4)
- Fluens.Web.Discovery (>= 0.9.4)
- Microsoft.AspNetCore.OpenApi (>= 10.0.13)
- Microsoft.EntityFrameworkCore.Relational (>= 10.0.13)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.13)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.13)
- Microsoft.Extensions.DependencyInjection (>= 10.0.13)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.13)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.13)
- Microsoft.Extensions.Logging (>= 10.0.13)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.13)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 10.0.13)
- Scalar.AspNetCore (>= 2.18.2)
- Scrutor (>= 7.0.0)
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.9.4 | 96 | 11/30/2026 |
| 0.9.3 | 104 | 11/17/2026 |
| 0.9.2 | 138 | 10/21/2026 |
| 0.9.1 | 122 | 10/13/2026 |
| 0.9.0 | 98 | 10/13/2026 |
| 0.8.7 | 109 | 10/12/2026 |
| 0.8.6 | 107 | 10/12/2026 |
| 0.8.5 | 119 | 10/7/2026 |
| 0.8.4 | 102 | 10/6/2026 |
| 0.8.3 | 111 | 10/6/2026 |
| 0.8.2 | 116 | 10/5/2026 |
| 0.8.1 | 129 | 9/15/2026 |
| 0.8.0 | 122 | 9/15/2026 |
| 0.7.11 | 127 | 9/15/2026 |
| 0.7.10 | 119 | 9/13/2026 |
| 0.7.9 | 128 | 9/11/2026 |
| 0.7.8 | 127 | 9/10/2026 |
| 0.7.7 | 140 | 9/10/2026 |
| 0.7.6 | 297 | 7/1/2026 |
| 0.7.5 | 157 | 6/22/2026 |