Skip to content

trafficShadow

const trafficShadow: (config?) => Policy

Defined in: src/policies/traffic/traffic-shadow.ts:58

Traffic shadow policy.

Mirrors traffic to a secondary upstream after the primary response is ready. The shadow request is fire-and-forget and never affects the primary response.

TrafficShadowConfig

Policy

import { trafficShadow } from "@homegrower-club/stoma";
trafficShadow({
target: "https://shadow.internal",
percentage: 10,
methods: ["POST", "PUT"],
});