TrafficShadowConfig
Defined in: src/policies/traffic/traffic-shadow.ts:25
Configuration for the trafficShadow policy.
Extends
Section titled “Extends”Properties
Section titled “Properties”methods?
Section titled “methods?”
optionalmethods:string[]
Defined in: src/policies/traffic/traffic-shadow.ts:31
Only mirror these HTTP methods. Default: ["GET", "POST", "PUT", "PATCH", "DELETE"].
mirrorBody?
Section titled “mirrorBody?”
optionalmirrorBody:boolean
Defined in: src/policies/traffic/traffic-shadow.ts:33
Include request body in shadow request. Default: true.
onError()?
Section titled “onError()?”
optionalonError: (error) =>void
Defined in: src/policies/traffic/traffic-shadow.ts:37
Optional error handler for shadow failures. Default: silent.
Parameters
Section titled “Parameters”unknown
Returns
Section titled “Returns”void
percentage?
Section titled “percentage?”
optionalpercentage:number
Defined in: src/policies/traffic/traffic-shadow.ts:29
Percentage of traffic to mirror, 0-100. Default: 100.
skip()?
Section titled “skip()?”
optionalskip: (c) =>boolean|Promise<boolean>
Defined in: src/policies/types.ts:33
Skip this policy when condition returns true
Parameters
Section titled “Parameters”unknown
Returns
Section titled “Returns”boolean | Promise<boolean>
Inherited from
Section titled “Inherited from”target
Section titled “target”target:
string
Defined in: src/policies/traffic/traffic-shadow.ts:27
URL of the shadow upstream (required).
timeout?
Section titled “timeout?”
optionaltimeout:number
Defined in: src/policies/traffic/traffic-shadow.ts:35
Timeout for shadow request in ms. Default: 5000.