Tracking Selectors

Select tracking id from header or message body with stable selectors.

Header Selector

Example: header:X-Correlation-Id. Selector helper APIs expose direct TrackingFieldSelector construction, Parse/TryParse, and string formatting helpers.

Body Selector

Examples: json:$.trackingId or json:$trackingId with optional MessagePayloadType for typed parsing. JSON property lookup is case-insensitive. Invalid selector expressions use the same helper error contract across SDKs.

Destination GatherByField

Optional selector using the same syntax as TrackingField; enables grouped correlation summaries and percentile trend charts.

Endpoint Base Fields

TrafficEndpointDefinition supports AutoGenerateTrackingIdWhenMissing, PollInterval, MessageHeaders, MessagePayload, MessagePayloadType, JsonSettings, JsonConvertSettings, and ContentType. PollInterval must be a positive value when explicitly configured. These apply across endpoint adapters.

Feature Usage Samples

How to use snippets for Tracking Selectors.

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.

Tracking Selectors

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

var destination = new KafkaEndpointDefinition
{
    Name = "kafka-destination",
    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(30)
};

Selector Formats

header:<name>

Extract the tracking value from a header using the supplied header name.

json:$.<path>

Extract the tracking value from a JSON body using a dotted JSON path expression.

json:$<path>

Use the same JSON extraction contract in the compact dollar-prefixed form.

TrackingFieldSelector(...)

Construct the selector directly in code when you want explicit location and path values instead of parsing a string.