@loadstrike/loadstrike-sdk 1.0.21401 → 1.0.22301
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +4 -2
- package/dist/cjs/local.js +10 -6
- package/dist/cjs/reporting.js +214 -75
- package/dist/cjs/runtime.js +24 -14
- package/dist/cjs/transports.js +16 -4
- package/dist/esm/index.js +1 -1
- package/dist/esm/local.js +11 -7
- package/dist/esm/reporting.js +214 -75
- package/dist/esm/runtime.js +26 -16
- package/dist/esm/transports.js +15 -3
- package/dist/types/contracts.d.ts +2 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/local.d.ts +1 -1
- package/dist/types/runtime.d.ts +1 -1
- package/dist/types/transports.d.ts +3 -1
- package/package.json +1 -1
package/dist/esm/runtime.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { appendFileSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
2
|
-
import { randomBytes } from "node:crypto";
|
|
2
|
+
import { randomBytes, randomUUID } from "node:crypto";
|
|
3
3
|
import os from "node:os";
|
|
4
4
|
import { resolve } from "node:path";
|
|
5
5
|
import { LoadStrikeLocalClient } from "./local.js";
|
|
6
6
|
import { DistributedClusterAgent, DistributedClusterCoordinator } from "./cluster.js";
|
|
7
7
|
import { CorrelationStoreConfiguration, CrossPlatformTrackingRuntime, RedisCorrelationStore, RedisCorrelationStoreOptions, TrackingFieldSelector } from "./correlation.js";
|
|
8
|
-
import { EndpointAdapterFactory } from "./transports.js";
|
|
8
|
+
import { EndpointAdapterFactory, LOADSTRIKE_TRACE_ID_TRACKING_FIELD } from "./transports.js";
|
|
9
9
|
import { buildDotnetCsvReport, buildDotnetHtmlReport, buildDotnetMarkdownReport, buildDotnetTxtReport } from "./reporting.js";
|
|
10
10
|
export const LoadStrikeNodeType = {
|
|
11
11
|
SingleNode: "SingleNode",
|
|
@@ -1706,9 +1706,10 @@ export class LoadStrikeScenario {
|
|
|
1706
1706
|
throw new Error("Tracking source endpoint must be provided.");
|
|
1707
1707
|
}
|
|
1708
1708
|
const destinationSpec = asTrackingRecord(pickTrackingValue(copied, "Destination", "destination"));
|
|
1709
|
-
const
|
|
1709
|
+
const useLoadStrikeTraceIdHeader = readUseLoadStrikeTraceIdHeader(copied);
|
|
1710
|
+
const sourceEndpoint = mapRuntimeTrackingEndpointSpec(sourceSpec, useLoadStrikeTraceIdHeader);
|
|
1710
1711
|
const destinationEndpoint = Object.keys(destinationSpec).length
|
|
1711
|
-
? mapRuntimeTrackingEndpointSpec(destinationSpec)
|
|
1712
|
+
? mapRuntimeTrackingEndpointSpec(destinationSpec, useLoadStrikeTraceIdHeader)
|
|
1712
1713
|
: null;
|
|
1713
1714
|
validateRuntimeTrackingConfiguration(copied, sourceEndpoint, destinationEndpoint);
|
|
1714
1715
|
return new LoadStrikeScenario(this.name, this.runHandler, this.initHandler, this.cleanHandler, this.loadSimulations, this.thresholds, copied, this.maxFailCount, this.withoutWarmUpValue, this.warmUpDurationSeconds, this.weight, this.restartIterationOnFail, this.internalLicenseFeatures);
|
|
@@ -5710,9 +5711,10 @@ class ManagedScenarioTrackingRuntime {
|
|
|
5710
5711
|
this.timeoutLoop = null;
|
|
5711
5712
|
const sourceSpec = asTrackingRecord(pickTrackingValue(tracking, "Source", "source"));
|
|
5712
5713
|
const destinationSpec = asTrackingRecord(pickTrackingValue(tracking, "Destination", "destination"));
|
|
5713
|
-
|
|
5714
|
+
const useLoadStrikeTraceIdHeader = readUseLoadStrikeTraceIdHeader(tracking);
|
|
5715
|
+
this.sourceEndpoint = mapRuntimeTrackingEndpointSpec(sourceSpec, useLoadStrikeTraceIdHeader);
|
|
5714
5716
|
this.destinationEndpoint = Object.keys(destinationSpec).length
|
|
5715
|
-
? mapRuntimeTrackingEndpointSpec(destinationSpec)
|
|
5717
|
+
? mapRuntimeTrackingEndpointSpec(destinationSpec, useLoadStrikeTraceIdHeader)
|
|
5716
5718
|
: null;
|
|
5717
5719
|
validateRuntimeTrackingConfiguration(tracking, this.sourceEndpoint, this.destinationEndpoint);
|
|
5718
5720
|
this.runMode = normalizeTrackingRunMode(pickTrackingString(tracking, "RunMode", "runMode", "GenerateAndCorrelate"));
|
|
@@ -6207,9 +6209,12 @@ function getScenarioTrackingRuntime(context, tracking) {
|
|
|
6207
6209
|
return lease.runtime;
|
|
6208
6210
|
}
|
|
6209
6211
|
function buildTrackingLeaseKey(sessionId, scenarioName, tracking) {
|
|
6210
|
-
const
|
|
6212
|
+
const useLoadStrikeTraceIdHeader = readUseLoadStrikeTraceIdHeader(tracking);
|
|
6213
|
+
const source = mapRuntimeTrackingEndpointSpec(asTrackingRecord(pickTrackingValue(tracking, "Source", "source")), useLoadStrikeTraceIdHeader);
|
|
6211
6214
|
const destinationSpec = asTrackingRecord(pickTrackingValue(tracking, "Destination", "destination"));
|
|
6212
|
-
const destination = Object.keys(destinationSpec).length
|
|
6215
|
+
const destination = Object.keys(destinationSpec).length
|
|
6216
|
+
? mapRuntimeTrackingEndpointSpec(destinationSpec, useLoadStrikeTraceIdHeader)
|
|
6217
|
+
: null;
|
|
6213
6218
|
const runMode = normalizeTrackingRunMode(pickTrackingString(tracking, "RunMode", "runMode", "GenerateAndCorrelate"));
|
|
6214
6219
|
return `${sessionId}|${scenarioName}|${source.name}|${destination?.name ?? "<source-only>"}|${runMode}`;
|
|
6215
6220
|
}
|
|
@@ -6289,6 +6294,9 @@ function validateRuntimeTrackingConfiguration(tracking, sourceEndpoint, destinat
|
|
|
6289
6294
|
}
|
|
6290
6295
|
throw new RangeError(`Unsupported tracking run mode: ${runMode}.`);
|
|
6291
6296
|
}
|
|
6297
|
+
function readUseLoadStrikeTraceIdHeader(tracking) {
|
|
6298
|
+
return pickTrackingBoolean(tracking, "UseLoadStrikeTraceIdHeader", "useLoadStrikeTraceIdHeader", false);
|
|
6299
|
+
}
|
|
6292
6300
|
function validateRuntimeRedisCorrelationStoreConfiguration(tracking) {
|
|
6293
6301
|
const storeSpec = asTrackingRecord(pickTrackingValue(tracking, "CorrelationStore", "correlationStore"));
|
|
6294
6302
|
const kind = pickTrackingString(storeSpec, "Kind", "kind", "").trim().toLowerCase();
|
|
@@ -6372,12 +6380,12 @@ function sanitizeTrackingNamespacePart(value) {
|
|
|
6372
6380
|
.replace(/\s+/g, "_");
|
|
6373
6381
|
}
|
|
6374
6382
|
async function produceOrConsumeTrackingPayload(adapter, endpoint, runMode, index) {
|
|
6375
|
-
|
|
6376
|
-
|
|
6377
|
-
|
|
6378
|
-
return normalizeRuntimeTrackingPayload(
|
|
6383
|
+
if (runMode === "correlateexistingtraffic") {
|
|
6384
|
+
return normalizeRuntimeObservedTrackingPayload(await adapter.consume(), endpoint);
|
|
6385
|
+
}
|
|
6386
|
+
return normalizeRuntimeTrackingPayload(await adapter.produce(), endpoint, index);
|
|
6379
6387
|
}
|
|
6380
|
-
function mapRuntimeTrackingEndpointSpec(spec) {
|
|
6388
|
+
function mapRuntimeTrackingEndpointSpec(spec, useLoadStrikeTraceIdHeader = false) {
|
|
6381
6389
|
const pollIntervalMs = Math.trunc(pickTrackingNumber(spec, ["PollIntervalMs", "pollIntervalMs"], pickTrackingNumber(spec, ["PollIntervalSeconds", "pollIntervalSeconds", "PollInterval"], 0.25) * 1000));
|
|
6382
6390
|
const httpSpec = asTrackingRecord(pickTrackingValue(spec, "Http", "http"));
|
|
6383
6391
|
const delegateSpec = asTrackingRecord(pickTrackingValue(spec, "delegate", "Delegate", "DelegateStream"));
|
|
@@ -6404,7 +6412,7 @@ function mapRuntimeTrackingEndpointSpec(spec) {
|
|
|
6404
6412
|
kind: pickTrackingString(spec, "Kind", "kind", "DelegateStream"),
|
|
6405
6413
|
mode: pickTrackingString(spec, "Mode", "mode", "Produce"),
|
|
6406
6414
|
name: pickTrackingString(spec, "Name", "name", "endpoint"),
|
|
6407
|
-
trackingField: pickTrackingSelectorString(spec, "TrackingField", "trackingField", "header:x-correlation-id"),
|
|
6415
|
+
trackingField: pickTrackingSelectorString(spec, "TrackingField", "trackingField", useLoadStrikeTraceIdHeader ? LOADSTRIKE_TRACE_ID_TRACKING_FIELD : "header:x-correlation-id"),
|
|
6408
6416
|
gatherByField: pickOptionalTrackingSelectorString(spec, "GatherByField", "gatherByField"),
|
|
6409
6417
|
autoGenerateTrackingIdWhenMissing: pickTrackingBoolean(spec, "AutoGenerateTrackingIdWhenMissing", "autoGenerateTrackingIdWhenMissing", true),
|
|
6410
6418
|
pollIntervalMs,
|
|
@@ -6510,7 +6518,9 @@ function normalizeRuntimeTrackingPayload(payload, endpoint, index) {
|
|
|
6510
6518
|
if (existing || !endpoint.autoGenerateTrackingIdWhenMissing) {
|
|
6511
6519
|
return normalized;
|
|
6512
6520
|
}
|
|
6513
|
-
const generated =
|
|
6521
|
+
const generated = endpoint.trackingField.trim().toLowerCase() === LOADSTRIKE_TRACE_ID_TRACKING_FIELD
|
|
6522
|
+
? randomUUID()
|
|
6523
|
+
: `${endpoint.name}-auto-${index + 1}`;
|
|
6514
6524
|
const selector = endpoint.trackingField.trim();
|
|
6515
6525
|
if (selector.toLowerCase().startsWith("header:")) {
|
|
6516
6526
|
const headerName = selector.slice("header:".length).trim();
|
|
@@ -8014,7 +8024,7 @@ function buildRichHtmlReport(result) {
|
|
|
8014
8024
|
<section id="scenarios" class="panel active">
|
|
8015
8025
|
${bars || "<div>No scenario data.</div>"}
|
|
8016
8026
|
<table>
|
|
8017
|
-
<thead><tr><th>Scenario</th><th>Requests</th><th>OK</th><th>Fail</th><th>TotalBytes</th><th>
|
|
8027
|
+
<thead><tr><th>Scenario</th><th>Requests</th><th>OK</th><th>Fail</th><th>TotalBytes</th><th>AvgLatency (ms)</th></tr></thead>
|
|
8018
8028
|
<tbody>${scenarioRows || "<tr><td colspan='6'>No rows</td></tr>"}</tbody>
|
|
8019
8029
|
</table>
|
|
8020
8030
|
</section>
|
package/dist/esm/transports.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { randomUUID } from "node:crypto";
|
|
2
2
|
import { TrackingFieldSelector } from "./correlation.js";
|
|
3
|
+
export const LOADSTRIKE_TRACE_ID_HEADER = "loadstrike-trace-id";
|
|
4
|
+
export const LOADSTRIKE_TRACE_ID_TRACKING_FIELD = `header:${LOADSTRIKE_TRACE_ID_HEADER}`;
|
|
3
5
|
class TrafficEndpointDefinitionModel {
|
|
4
6
|
get JsonSerializerSettings() {
|
|
5
7
|
return this.JsonSettings;
|
|
@@ -1048,8 +1050,9 @@ class HttpEndpointAdapter extends CallbackAdapter {
|
|
|
1048
1050
|
if (this.endpoint.mode !== "Produce") {
|
|
1049
1051
|
return null;
|
|
1050
1052
|
}
|
|
1051
|
-
const resolved = payload ?? this.defaultPayload();
|
|
1052
1053
|
const httpOptions = this.endpoint.http;
|
|
1054
|
+
const responseTracking = canonicalizeHttpTrackingPayloadSource(String(httpOptions?.trackingPayloadSource ?? "Request")) === "Response";
|
|
1055
|
+
const resolved = prepareProducedPayload(this.endpoint, payload, !responseTracking);
|
|
1053
1056
|
if (!httpOptions?.url) {
|
|
1054
1057
|
return super.produce(resolved);
|
|
1055
1058
|
}
|
|
@@ -2951,7 +2954,7 @@ function createDefaultPayload(endpoint) {
|
|
|
2951
2954
|
jsonConvertSettings: endpoint.jsonConvertSettings ? { ...endpoint.jsonConvertSettings } : undefined
|
|
2952
2955
|
});
|
|
2953
2956
|
}
|
|
2954
|
-
function prepareProducedPayload(endpoint, payload) {
|
|
2957
|
+
function prepareProducedPayload(endpoint, payload, allowAutoGenerateTrackingId = true) {
|
|
2955
2958
|
const base = payload
|
|
2956
2959
|
? attachPayloadHelpers({
|
|
2957
2960
|
headers: {
|
|
@@ -2970,15 +2973,24 @@ function prepareProducedPayload(endpoint, payload) {
|
|
|
2970
2973
|
if (trackingId) {
|
|
2971
2974
|
return base;
|
|
2972
2975
|
}
|
|
2976
|
+
if (!allowAutoGenerateTrackingId) {
|
|
2977
|
+
return base;
|
|
2978
|
+
}
|
|
2973
2979
|
if (endpoint.autoGenerateTrackingIdWhenMissing === false) {
|
|
2974
2980
|
throw new Error(`Tracking id could not be extracted using selector \`${endpoint.trackingField}\` and AutoGenerateTrackingIdWhenMissing is disabled for endpoint \`${endpoint.name}\`.`);
|
|
2975
2981
|
}
|
|
2976
|
-
const generated =
|
|
2982
|
+
const generated = isLoadStrikeTraceSelector(endpoint.trackingField)
|
|
2983
|
+
? randomUUID()
|
|
2984
|
+
: randomUUID().replace(/-/g, "");
|
|
2977
2985
|
if (!injectTrackingValue(base, endpoint.trackingField, generated)) {
|
|
2978
2986
|
throw new Error(`Tracking id could not be injected using selector \`${endpoint.trackingField}\` for endpoint \`${endpoint.name}\`. Verify the selector and payload shape.`);
|
|
2979
2987
|
}
|
|
2980
2988
|
return base;
|
|
2981
2989
|
}
|
|
2990
|
+
function isLoadStrikeTraceSelector(selector) {
|
|
2991
|
+
const trimmed = selector.trim();
|
|
2992
|
+
return trimmed.toLowerCase() === LOADSTRIKE_TRACE_ID_TRACKING_FIELD;
|
|
2993
|
+
}
|
|
2982
2994
|
function toWirePayload(payload, endpoint) {
|
|
2983
2995
|
return {
|
|
2984
2996
|
headers: { ...(payload.headers ?? {}) },
|
|
@@ -76,6 +76,7 @@ export interface LoadStrikeTrackingConfigurationSpec {
|
|
|
76
76
|
TrackingFieldValueCaseSensitive?: boolean;
|
|
77
77
|
GatherByFieldValueCaseSensitive?: boolean;
|
|
78
78
|
ExecuteOriginalScenarioRun?: boolean;
|
|
79
|
+
UseLoadStrikeTraceIdHeader?: boolean;
|
|
79
80
|
MetricPrefix?: string;
|
|
80
81
|
CorrelationStore?: LoadStrikeCorrelationStoreSpec;
|
|
81
82
|
}
|
|
@@ -93,7 +94,7 @@ export interface LoadStrikeEndpointSpec {
|
|
|
93
94
|
Kind: string;
|
|
94
95
|
Name: string;
|
|
95
96
|
Mode: string;
|
|
96
|
-
TrackingField
|
|
97
|
+
TrackingField?: string;
|
|
97
98
|
GatherByField?: string;
|
|
98
99
|
AutoGenerateTrackingIdWhenMissing?: boolean;
|
|
99
100
|
PollIntervalSeconds?: number;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export { CrossPlatformScenarioConfigurator, ScenarioTrackingExtensions, LoadStri
|
|
|
6
6
|
export type { ILoadStrikeReportingSink, ILoadStrikeWorkerPlugin, LoadStrikeRunResult, LoadStrikeReportingSink, LoadStrikeRuntimePolicy, LoadStrikeRunnerOptions, LoadStrikeRunContext as LoadStrikeRuntimeContext, LoadStrikeRunContext, LoadStrikeBaseContext, LoadStrikeCounterStats, LoadStrikeDataTransferStats, LoadStrikeGaugeStats, LoadStrikeLogger, LoadStrikeLoadSimulationStats, LoadStrikeMeasurementStats, LoadStrikeMetricStats, LoadStrikeNodeInfo, LoadStrikeMetricValue, LoadStrikeRandom, LoadStrikeReply, LoadStrikeLatencyCount, LoadStrikeLatencyStats, LoadStrikeLoadSimulation, LoadStrikeScenarioInfo, LoadStrikeScenarioInitContext, LoadStrikeScenarioPartition, LoadStrikeScenarioStartInfo, LoadStrikeScenarioContext, LoadStrikeScenarioStats, LoadStrikeTestInfo, LoadStrikeScenarioRuntime, LoadStrikeSessionStartInfo, LoadStrikeSinkSession, LoadStrikeSinkError, LoadStrikeStatusCodeStats, LoadStrikeThresholdResult, LoadStrikeThresholdPredicateContext, CrossPlatformTrackingConfiguration, LoadStrikeStepReply, LoadStrikeStepStats, LoadStrikeStepRuntime, LoadStrikeThresholdOptions, LoadStrikeRequestStats, LoadStrikeWorkerPlugin } from "./runtime.js";
|
|
7
7
|
export { CorrelationStoreConfiguration, CrossPlatformTrackingRuntime, InMemoryCorrelationStore, RedisCorrelationStoreOptions, RedisCorrelationStore, TrackingPayloadBuilder, TrackingFieldSelector } from "./correlation.js";
|
|
8
8
|
export type { CorrelationEntry, DestinationConsumeResult, GatheredRow, CorrelationStoreKind, CorrelationRuntimeOptions, CorrelationRuntimePlugin, CorrelationRuntimeStats, CorrelationStore, SourceProduceResult, TrackingFieldLocation, TrackingPayload } from "./correlation.js";
|
|
9
|
-
export { EndpointAdapterFactory, TrafficEndpointDefinition, HttpEndpointDefinition, KafkaEndpointDefinition, KafkaSaslOptions, RabbitMqEndpointDefinition, NatsEndpointDefinition, RedisStreamsEndpointDefinition, AzureEventHubsEndpointDefinition, DelegateStreamEndpointDefinition, PushDiffusionEndpointDefinition, HttpOAuth2ClientCredentialsOptions, HttpAuthOptions } from "./transports.js";
|
|
9
|
+
export { EndpointAdapterFactory, LOADSTRIKE_TRACE_ID_HEADER, LOADSTRIKE_TRACE_ID_TRACKING_FIELD, TrafficEndpointDefinition, HttpEndpointDefinition, KafkaEndpointDefinition, KafkaSaslOptions, RabbitMqEndpointDefinition, NatsEndpointDefinition, RedisStreamsEndpointDefinition, AzureEventHubsEndpointDefinition, DelegateStreamEndpointDefinition, PushDiffusionEndpointDefinition, HttpOAuth2ClientCredentialsOptions, HttpAuthOptions } from "./transports.js";
|
|
10
10
|
export type { EndpointAdapter, EndpointDefinition, EndpointDefinitionInput, EndpointKind, EndpointMode, DotNetDelegateEndpointOptions, DotNetEndpointDefinition, DotNetHttpAuthOptions, DotNetHttpEndpointOptions, DotNetHttpOAuth2ClientCredentialsOptions, HttpAuthMode, HttpAuthType, HttpRequestBodyType, HttpResponseSource, HttpTrackingPayloadSource, KafkaSaslMechanismType, KafkaSecurityProtocolType, HttpEndpointOptions, KafkaEndpointOptions, RabbitMqEndpointOptions, NatsEndpointOptions, RedisStreamsEndpointOptions, AzureEventHubsEndpointOptions, PushDiffusionEndpointOptions, TrackingFieldSelectorInput, TrackingRunMode, TrafficEndpointKind, TrafficEndpointMode, ProducedMessageRequest, ProducedMessageResult, ConsumedMessage, DelegateConsumeAsync, DelegateConsumeStreamHandler, DelegateEndpointOptions } from "./transports.js";
|
|
11
11
|
export { DatadogReportingSink, DatadogReportingSinkOptions, GrafanaLokiReportingSink, GrafanaLokiReportingSinkOptions, InfluxDbReportingSink, InfluxDbReportingSinkOptions, OtelCollectorReportingSink, OtelCollectorReportingSinkOptions, SplunkReportingSink, SplunkReportingSinkOptions, TimescaleDbReportingSink, TimescaleDbReportingSinkOptions } from "./sinks.js";
|
|
12
12
|
export type { DatadogSinkOptions, GrafanaLokiSinkOptions, InfluxDbSinkOptions, OtelCollectorSinkOptions, SplunkSinkOptions, TimescaleDbSinkOptions } from "./sinks.js";
|
package/dist/types/local.d.ts
CHANGED
|
@@ -67,7 +67,7 @@ declare function evaluateScenarioOutcome(scenario: Record<string, unknown>, requ
|
|
|
67
67
|
}>;
|
|
68
68
|
declare function validateTrackingConfiguration(tracking: Record<string, unknown>, sourceEndpoint: EndpointDefinition, destinationEndpoint: EndpointDefinition | null): void;
|
|
69
69
|
declare function inferLegacyHttpResponseSourceValue(value: string | undefined): "ResponseBody" | "ResponseHeaders" | "ResponseStatusCode" | undefined;
|
|
70
|
-
declare function mapEndpointSpec(spec: Record<string, unknown
|
|
70
|
+
declare function mapEndpointSpec(spec: Record<string, unknown>, useLoadStrikeTraceIdHeader?: boolean): EndpointDefinition;
|
|
71
71
|
declare function normalizePayload(payload: TrackingPayload | null, endpoint: EndpointDefinition, index: number): TrackingPayload;
|
|
72
72
|
declare function readTrackingId(payload: TrackingPayload, selector: string): string | null;
|
|
73
73
|
declare function readOptionalTrackingSelectorValue(value: unknown): string | undefined;
|
package/dist/types/runtime.d.ts
CHANGED
|
@@ -2103,7 +2103,7 @@ declare function readRuntimeRedisCorrelationStoreOptions(redisSpec: Record<strin
|
|
|
2103
2103
|
declare function buildTrackingRunNamespace(sessionId: string, scenarioName: string, sourceName: string, destinationName?: string | null): string;
|
|
2104
2104
|
declare function sanitizeTrackingNamespacePart(value: string): string;
|
|
2105
2105
|
declare function produceOrConsumeTrackingPayload(adapter: EndpointAdapter, endpoint: EndpointDefinition, runMode: string, index: number): Promise<TrackingPayload | null>;
|
|
2106
|
-
declare function mapRuntimeTrackingEndpointSpec(spec: Record<string, unknown
|
|
2106
|
+
declare function mapRuntimeTrackingEndpointSpec(spec: Record<string, unknown>, useLoadStrikeTraceIdHeader?: boolean): EndpointDefinition;
|
|
2107
2107
|
declare function normalizeRuntimeTrackingPayload(payload: TrackingPayload | null, endpoint: EndpointDefinition, index: number): TrackingPayload;
|
|
2108
2108
|
declare function readRuntimeTrackingId(payload: TrackingPayload, selector: string): string | null;
|
|
2109
2109
|
declare function runtimeParseBodyAsObject(body: unknown): Record<string, unknown> | null;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { TrackingFieldSelector, type TrackingPayload } from "./correlation.js";
|
|
2
|
+
export declare const LOADSTRIKE_TRACE_ID_HEADER = "loadstrike-trace-id";
|
|
3
|
+
export declare const LOADSTRIKE_TRACE_ID_TRACKING_FIELD = "header:loadstrike-trace-id";
|
|
2
4
|
export type EndpointKind = "Http" | "Kafka" | "RabbitMq" | "Nats" | "RedisStreams" | "AzureEventHubs" | "PushDiffusion" | "DelegateStream";
|
|
3
5
|
export type EndpointMode = "Produce" | "Consume";
|
|
4
6
|
export type HttpAuthMode = "None" | "Basic" | "Bearer" | "OAuth2ClientCredentials";
|
|
@@ -804,7 +806,7 @@ declare function attachPayloadHelpers(payload: TrackingPayload): TrackingPayload
|
|
|
804
806
|
declare function attachDotNetTrackingPayloadAliases<T extends TrackingPayload>(payload: T): T;
|
|
805
807
|
declare function attachStructuredProducedMessageRequestAliases(request: ProducedMessageRequest, endpoint: EndpointDefinition): ProducedMessageRequest;
|
|
806
808
|
declare function createDelegateRequestEndpointView(endpoint: EndpointDefinition): Record<string, unknown>;
|
|
807
|
-
declare function prepareProducedPayload(endpoint: EndpointDefinition, payload?: TrackingPayload): TrackingPayload;
|
|
809
|
+
declare function prepareProducedPayload(endpoint: EndpointDefinition, payload?: TrackingPayload, allowAutoGenerateTrackingId?: boolean): TrackingPayload;
|
|
808
810
|
declare function serializePayloadBody(body: unknown, contentType?: string): Uint8Array;
|
|
809
811
|
declare function deserializeBrokerPayloadBody(body: Uint8Array, contentType?: string, messagePayloadType?: string): unknown;
|
|
810
812
|
declare function extractTrackingValue(payload: TrackingPayload, selector: string): string | null;
|
package/package.json
CHANGED