MarbleSoft.FlowModule.TraceInitializer 1.5.4

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

MarbleSoft.FlowModule.TraceInitializer

TraceInitializer ensures that each processed message carries a trace flow-chain context.

MQTT integration uses MQTTnet 4.0.0.167.

If a trace context is missing, the module creates one. If a trace context already exists, the module normalizes missing root fields and appends a new open flow entry only when needed.

Settings

The settings are defined in TraceInitializerSettings.cs.

  1. Source
  • Type: string
  • Required: yes
  • Validation: min length 1, max length 256
  • Default: data.headers.traces.flowChain
  • Purpose: input path used to read existing trace context
  1. Target
  • Type: string
  • Required: yes
  • Validation: min length 1, max length 256
  • Default: data.headers.traces.flowChain
  • Purpose: output path used to write trace context
  1. Flow Chain Name
  • Type: string
  • Required: no
  • Validation: optional, max length 128
  • Default: empty
  • Purpose: optional name written to trace flow-chain name field
  1. Only if trace exists
  • Type: bool
  • Default: false
  • Purpose: create a trace only when an existing trace chain already contains flow entries; otherwise the message is forwarded unchanged
  1. Apply condition
  • Type: bool
  • Default: false
  • Purpose: evaluate the configured condition before creating a trace; if the condition is false, the message is passed through unchanged
  1. Condition left / operator / right
  • Type: string
  • Purpose: compare a value or message path against another value or path using operators such as ==, !=, >, >=, <, ⇐, contains, startsWith, endsWith
  • Fix: nested message paths are resolved against dictionaries and object graphs before comparison, so conditions like payloadItem.nodeId or payload.items[0].status work reliably when deciding whether a trace should be added
  1. FlowTraceName suffix
  • Type: string
  • Purpose: add a readable suffix to the runtime flow name for the per-flow flowTraceName value, for example "write to OPC" becomes "HEXSRP1693 write to OPC" while the base trace name remains the environment flow name
  1. MQTT publish settings (optional)
  • Enable MQTT Publish: bool, default true
  • MQTT Source Property: string path, default data, if empty the full message/trace payload is used
  • MQTT Topic: string, required when MQTT is enabled
  • MQTT Brokers: comma or line separated host:port list, default localhost:1883
  • MQTT Protocol Version: enum V311 or V500
  • Use TLS: bool, default true
  • SSL Protocol: enum None, Tls12, Tls13
  • Allow Untrusted Certificates: bool
  • ClientId: optional string, generated automatically when empty
  • CA Certificate: optional Crosser Certificate credential selector
  • Client Certificate: optional Crosser Certificate credential selector
  • MQTT User Credential: optional Crosser UsernamePassword credential selector
  • QoS: AtMostOnce, AtLeastOnce, ExactlyOnce
  • Retain: bool
  • Last Will Topic/Payload/QoS/Retain: available as settings (currently retained for forward-compatible API mapping)

Flow and module metadata are resolved programmatically at runtime. The module attempts runtime values first and then environment-variable fallbacks, for example FLOW_ID, FLOW_VERSION, FLOW_NAME, FLOW_DEFINITION_ID, FLOW_DEPLOYMENT_ID, MODULE_ID.

Runtime behavior

When no trace is found:

  • Creates id (GUID)
  • Creates startTimeUtc (UTC timestamp)
  • Sets createdByModule from runtime module id
  • Sets createdByFlow from runtime flow id
  • Resolves the base trace name from the Flow Chain Name setting or the runtime flow name; the optional FlowTraceNameSuffix is applied only to the individual flow entry flowTraceName value
  • Initializes flows list
  • Appends a new open flow entry with:
    • sequence = next sequence number
    • flowRunId = GUID
    • flowId = resolved runtime flow id
    • flowVersion = resolved runtime flow version
    • flowStartTimeUtc = current UTC timestamp
    • flowEndTimeUtc = null
    • duration_ms = null

Optional gate conditions:

  • CreateTraceOnlyWhenChainExists skips trace creation when no existing trace flow chain is present
  • ApplyTraceCondition evaluates the configured rule before a new trace is created; when it evaluates to false, the message is forwarded unchanged

When trace already exists:

  • Ensures id, startTimeUtc, createdByModule, createdByFlow, name are populated
  • Ensures flows list exists
  • Appends a new entry only if the last entry is not already the same open flow (same flowId + flowVersion with empty flowEndTimeUtc)
  • Supports fallback read from legacy paths header.trace and trace

MQTT behavior:

  • MQTT client is initialized on module start when Enable MQTT Publish is true
  • Broker failover is applied in configured order from MQTT Brokers
  • For each processed message, the configured source payload is published to MQTT Topic with configured QoS/Retain
  • On successful publish, the latest flow entry gets mqttOutTopic populated
  • MQTT implementation uses MQTTnet 4.0.0.167

Minimal configuration example

Source: data.headers.traces.flowChain Target: data.headers.traces.flowChain Flow Chain Name: JobManagement

Output structure excerpt

{
	"data": {
		"headers": {
			"traces": {
				"flowChain": {
					"id": "9b2a59dc-18b4-4acb-8381-8b3c7b915ae7",
					"startTimeUtc": "2026-06-11T11:39:28.7473848Z",
					"endTimeUtc": "",
					"duration_ms": null,
					"createdByModule": "0d454d32-348f-4383-b610-afd6697b1195",
					"createdByFlow": "02f68cf5-f5c4-48c3-9d3d-62229a378889",
					"name": "JobManagement",
					"flows": [
						{
							"flowId": "02f68cf5-f5c4-48c3-9d3d-62229a378889",
							"flowRunId": "de6a8eee-2c6f-4ddb-877c-2e1c6982d779",
							"flowStartTimeUtc": "2026-06-11T11:39:28.7473940Z",
							"flowEndTimeUtc": null,
							"duration_ms": null,
							"flowVersion": "13",
							"sequence": 1
						}
					]
				}
			}
		}
	}
}

Build and pack

From repository root:

  1. Build dotnet build crosser-trace-initializer.sln -c Debug

  2. Pack TraceInitializer dotnet pack MarbleSoft.FlowModule.TraceInitializer/Module/MarbleSoft.FlowModule.TraceInitializer.csproj

Product 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. 
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.6.1 21 9/15/2026
1.6.0 38 9/15/2026
1.5.9 51 9/14/2026
1.5.8 53 9/14/2026
1.5.7 45 9/14/2026
1.5.6 53 9/11/2026
1.5.5 65 9/11/2026
1.5.4 49 9/11/2026
1.5.3 50 9/11/2026
1.5.2 52 9/10/2026
1.5.1 47 9/10/2026
1.5.0 49 9/10/2026
1.4.3 104 7/30/2026
1.4.1 94 7/21/2026
1.4.0 101 7/21/2026
1.3.6 101 7/3/2026
1.3.5 95 7/3/2026
1.3.4 100 7/3/2026
1.3.3 96 7/3/2026
1.3.2 111 7/3/2026
Loading failed

N/A