FluxFlow.Components.Observability 3.0.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package FluxFlow.Components.Observability --version 3.0.2
                    
NuGet\Install-Package FluxFlow.Components.Observability -Version 3.0.2
                    
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="FluxFlow.Components.Observability" Version="3.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FluxFlow.Components.Observability" Version="3.0.2" />
                    
Directory.Packages.props
<PackageReference Include="FluxFlow.Components.Observability" />
                    
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 FluxFlow.Components.Observability --version 3.0.2
                    
#r "nuget: FluxFlow.Components.Observability, 3.0.2"
                    
#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 FluxFlow.Components.Observability@3.0.2
                    
#: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=FluxFlow.Components.Observability&version=3.0.2
                    
Install as a Cake Addin
#tool nuget:?package=FluxFlow.Components.Observability&version=3.0.2
                    
Install as a Cake Tool

FluxFlow.Components.Observability

Standalone observer nodes for FluxFlow — counter, logger, and metrics. Each depends only on FluxFlow.Nodes (and FluxFlow.Mapping for the counter's optional predicate) — no engine, registry, or runtime. You new the node and LinkTo the next one.

Nodes

Node Shape Purpose
FlowCounterNode<TInput> Input → Output (FlowCounterSnapshot) Counts accepted inputs and emits counter snapshots.
FlowLoggerNode<TInput> Input → Output (FlowLogEntry) Emits structured log entries from inputs.
FlowMetricsNode<TInput> Input → Output (FlowMetricSnapshot) Emits count, rate, timestamp, and optional size snapshots.

Every message travels as a FlowMessage<T> envelope. Each node broadcasts its result on Output carrying the same correlation id as the input; failures surface on Errors (with the input's correlation id and a Code from ObservabilityErrorCodes) and diagnostics flow on Events. The package emits neutral contracts only — hosts decide whether those entries or snapshots become app logs, dashboards, files, telemetry, or test assertions.

All observability nodes require a non-empty InputType and BoundedCapacity greater than zero. Invalid options fail fast during node construction before the input pipeline is created. Logger Level is also validated during construction.

Counter

await using var node = new FlowCounterNode<MyMessage>(
    new FlowCounterOptions { InputType = "message", Name = "received", Predicate = "value.Enabled" },
    expressionEngine);

node.Output.LinkTo(snapshotSink, new DataflowLinkOptions { PropagateCompletion = false });
await node.Input.SendAsync(FlowMessage.Create(message));

FlowCounterNode emits FlowCounterSnapshot values with count, rejected count, last observed timestamp, name, and input type. When a predicate is configured it is compiled once at construction from the supplied IFlowExpressionEngine; inputs the predicate rejects are not counted (but are tallied in RejectedCount). With no predicate every input is counted and no engine is required. Pass an IFlowMapContextFactory<TInput> to control the variables the predicate sees (defaults to input/value).

Logger

await using var node = new FlowLoggerNode<MyMessage>(
    new FlowLoggerOptions
    {
        InputType = "message",
        Level = "Information",
        Category = "workflow",
        MessageTemplate = "Observed {kind} item #{sequence}"
    },
    attributeSelectors: new Dictionary<string, IObservabilityValueSelector<MyMessage>>
    {
        ["kind"] = new KindSelector()
    });

FlowLoggerNode emits FlowLogEntry values. Supply IObservabilityValueSelector<TInput> selectors keyed by attribute name to enrich each entry; an attribute-selector failure is reported on Errors, the offending attribute is skipped, and the entry is still emitted. An unsupported Level throws InvalidOperationException at construction.

Metrics

await using var node = new FlowMetricsNode<MyMessage>(
    new FlowMetricsOptions { InputType = "message", Name = "received", SizeSelector = "payloadBytes" },
    sizeSelector: new PayloadSizeSelector());

FlowMetricsNode emits FlowMetricSnapshot values with total count, current rate, average rate, last observed timestamp, and optional size values. The optional size selector can return numeric values, strings, byte arrays, or collections; a size-selector failure is reported on Errors and the node keeps processing.

Runtime timing

Snapshots and log entries use the node's clock for Timestamp (default TimeProvider.System). Provide a deterministic clock for tests:

new FlowMetricsNode<MyMessage>(options, sizeSelector, clock: new FakeTimeProvider(timestamp));

A time provider also makes counter/metrics rate calculations deterministic.

Composition

Building a workflow, reading config, creating nodes, and linking them is a separate concern from these observer nodes. This package is just the standalone nodes.

Use FluxFlow.Components.Observability.Composition when a FluxFlow.Composition host should register optional observability factories:

services
    .AddFluxFlowComposition(configuration)
    .RegisterNodes(registry => registry
        .RegisterCounter<MyMessage>()
        .RegisterLogger<MyMessage>()
        .RegisterMetrics<MyMessage>());

The composition adapter binds the existing options records from node configuration. It resolves host-owned keyed resources for clock, counter engine and contextFactory, metrics sizeSelector, and logger attribute selectors named as attribute:{name}. Invalid observability options, such as blank inputType, non-positive boundedCapacity, or unsupported logger level, fail during composition build and surface as factory diagnostics when build failures are configured as diagnostics.

The optional composition package also exposes ObservabilityComponentDesignMetadataProvider for neutral Designer metadata over the flow.counter, flow.logger, and flow.metrics composition node types. The standalone Observability package remains free of Designer, Composition, and Engine dependencies.

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.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on FluxFlow.Components.Observability:

Package Downloads
FluxFlow.Components.Observability.Composition

Typed observability registration and Designer metadata over host-owned expression, selector, context, and clock resources.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
8.0.0-rc.1 83 9/5/2026
7.0.0 190 8/3/2026
3.0.2 124 7/3/2026
3.0.1 170 7/2/2026
3.0.0 116 6/19/2026
2.0.0 137 6/18/2026
1.2.1 123 6/15/2026
1.2.0 430 6/12/2026
1.1.0 116 6/5/2026
1.0.0 118 6/4/2026
0.3.0-alpha.1 239 6/2/2026
0.2.0-alpha.1 74 6/2/2026
0.1.1-alpha.1 75 6/2/2026
0.1.0-alpha.1 130 6/1/2026

Adds the shared FluxFlow package icon. No source, API, or dependency changes.