Correlation Runtime Controls

Tune correlation runtime behavior, timeout sweeps, and comparison rules when the default matching behavior needs adjustment.

What this page helps you do

What this page helps you do

Tune correlation runtime behavior, timeout sweeps, and comparison rules when the default matching behavior needs adjustment.

Who this is for

Teams controlling runtime behavior, tracking, reporting, licensing, or policy from code, JSON, or CLI settings.

Prerequisites

  • A scenario or run configuration that already works locally

By the end

The documented runtime setting or policy surface for this part of the product.

Use this page when

Use this page when runtime behavior changes because of configuration, policy, or execution settings rather than the scenario body itself.

Visual guide

Transaction diagram showing source action, handoff, downstream processing, and completion.
The settings on this page only make sense when the workflow is treated as one transaction from source action to downstream completion.

Guide

Execution Toggle

ExecuteOriginalScenarioRun controls whether the original scenario run delegate still executes alongside the tracking runtime in wrapped scenarios. Use it when the scenario should keep its original execution behavior as correlation is added around it.

Correlation Store Helpers

CorrelationStoreConfiguration exposes the in-memory and Redis helper constructors directly on the public SDK surface. Go now publishes the same InMemory() and RedisStore(...) helper names as the other SDKs, so the store selection docs and sample references stay aligned when you switch languages.

Timeout Sweep Settings

TimeoutSweepInterval controls how often timeout scans run, and TimeoutBatchSize controls how many pending items are processed in each sweep cycle. Public SDK helpers also expose sweepTimeoutEntries(...) for detailed timeout batches and preserve FIFO matching across repeated tracking IDs. Time durations must be positive when they are set through endpoint or config contracts.

Value Comparison Controls

TrackingFieldValueCaseSensitive and GatherByFieldValueCaseSensitive both default to true. Turn either one off when matching or grouping should ignore case, while the report still keeps the first-seen original value casing.

Metric Prefix

MetricPrefix controls the naming prefix used for tracking counters and gauges written to the Metrics report section and realtime sinks.

Store TTL

When Redis is used as the correlation store, RedisCorrelationStoreOptions.EntryTtl controls how long correlation entries are retained.

Configuration samples

Use these samples to see how Correlation Runtime Controls is configured in code, JSON, or CLI surfaces where this page documents them.

If you run these examples locally, add a valid runner key before execution starts. Set it with WithRunnerKey("...") or the config key LoadStrike:RunnerKey.

Runtime Controls

using LoadStrike;

var source = new HttpEndpointDefinition
{
    Name = "orders-api",
    Mode = TrafficEndpointMode.Produce,
    TrackingField = TrackingFieldSelector.Parse("header:X-Correlation-Id"),
    Url = "https://api.example.com/orders",
    Method = "POST"
};

var destination = new KafkaEndpointDefinition
{
    Name = "orders-events",
    Mode = TrafficEndpointMode.Consume,
    TrackingField = TrackingFieldSelector.Parse("header:X-Correlation-Id"),
    BootstrapServers = "localhost:9092",
    Topic = "orders.completed",
    ConsumerGroupId = "orders-tests"
};

var tracking = new CrossPlatformTrackingConfiguration
{
    Source = source,
    Destination = destination,
    RunMode = TrackingRunMode.GenerateAndCorrelate,
    CorrelationTimeout = TimeSpan.FromSeconds(15),
    TimeoutSweepInterval = TimeSpan.FromMilliseconds(250),
    TimeoutBatchSize = 200,
    TimeoutCountsAsFailure = true,
    TrackingFieldValueCaseSensitive = false,
    GatherByFieldValueCaseSensitive = false,
    MetricPrefix = "orders_tracking",
    CorrelationStore = CorrelationStoreConfiguration.RedisStore(new RedisCorrelationStoreOptions
    {
        ConnectionString = "localhost:6379",
        KeyPrefix = "loadstrike:orders",
        EntryTtl = TimeSpan.FromMinutes(5)
    })
};

var scenario = CrossPlatformScenarioConfigurator
    .Configure(LoadStrikeScenario.Empty("orders-runtime-controls"), tracking)
    .WithLoadSimulations(LoadStrikeSimulation.Inject(10, TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(20)));

LoadStrikeRunner.RegisterScenarios(scenario)
    .WithRunnerKey("rkl_your_local_runner_key")
    .Run();

Correlation runtime fields

Source

Required source endpoint definition.

Destination

Optional in GenerateAndCorrelate, required in CorrelateExistingTraffic.

RunMode

Selects whether LoadStrike produces the source traffic or only observes existing traffic.

CorrelationTimeout

How long a source event may wait for a match. Must be positive.

TimeoutSweepInterval

How often pending items are checked for timeout expiry. Must be positive.

TimeoutBatchSize

How many expired correlation entries are processed in one sweep. Must be positive.

TimeoutCountsAsFailure

Decides whether timed-out entries count toward failure totals in reports and sink exports.

TrackingFieldValueCaseSensitive

Defaults to true. When false, source and destination tracking values are matched without case, but reports keep the first-seen original value casing.

GatherByFieldValueCaseSensitive

Defaults to true. When false, GatherByField values are grouped without case, but reports keep the first-seen original group value casing.

ExecuteOriginalScenarioRun

Runs the original scenario delegate in addition to the tracking runtime when you need both behaviors together.

MetricPrefix

Required prefix for the correlation counters and gauges emitted by the runtime.

CorrelationStore

Selects the storage backing for pending matches. Use InMemory for simple runs or RedisStore(...) when correlation state must survive broader distributed conditions.

Any timeout or poll value you set directly must be a positive value.