Run Modes

Choose between generated traffic correlation and observing existing traffic.

GenerateAndCorrelate

LoadStrike produces source events and tracks destination outcomes.

CorrelateExistingTraffic

Both source and destination are consumed from existing flows.

Feature Usage Samples

How to use snippets for Run Modes.

Switch between C#, Java, Python, TypeScript, and JavaScript to see the native SDK shape for this sample.

Licensing note: every runnable sample requires a valid runner key via WithRunnerKey("...") or config key LoadStrike:RunnerKey.

Run Modes

var generateAndCorrelate = new CrossPlatformTrackingConfiguration
{
    Source = new HttpEndpointDefinition
    {
        Name = "orders-api",
        Mode = TrafficEndpointMode.Produce,
        TrackingField = TrackingFieldSelector.Parse("header:X-Correlation-Id"),
        Url = "https://orders.example.com/api/orders",
        Method = "POST"
    },
    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"
    },
    RunMode = TrackingRunMode.GenerateAndCorrelate
};

var correlateExistingTraffic = new CrossPlatformTrackingConfiguration
{
    Source = new KafkaEndpointDefinition
    {
        Name = "orders-inbound",
        Mode = TrafficEndpointMode.Consume,
        TrackingField = TrackingFieldSelector.Parse("json:$.trackingId"),
        BootstrapServers = "localhost:9092",
        Topic = "orders.inbound",
        ConsumerGroupId = "orders-inbound-tests"
    },
    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"
    },
    RunMode = TrackingRunMode.CorrelateExistingTraffic
};

Mode Meaning

GenerateAndCorrelate

Produce source traffic from LoadStrike and then match the resulting destination events.

CorrelateExistingTraffic

Observe both sides of an already-running flow and match source and destination activity without producing the source event yourself.