Menu

Important: This documentation is about an older version. It's relevant only to the release noted, many of the features and functions have been updated or replaced. Please view the current version.

Open source

gRPC

A gRPC Fault describes the characteristics of the faults to be injected in the gRPC requests served by a target.

A gRPC fault is described by the following attributes:

AttributeTypeDescription
averageDelaystringaverage delay added to requests represented as a string (default 0)
delayVariationstringvariation in the injected delay (default 0)
statusMessagestringmessage to be returned when an error is injected
statusCodenumberstatus to be returned when an error is injected
errorRatenumberrate of requests that will return an error, represented as a float in the range 0.0 to 1.0 (default 0.0)
excludestringcomma-separated list of services to be excluded from disruption
portnumberport on which the requests will be intercepted

Note

averageDelay and delayVariation are applied to all requests affected by the fault, regardless of the value of errorRate. statusCode is returned only to a fraction of requests defined by errorRate.

Example

This example defines a gRPC fault that introduces a delay of 50ms in all requests and returns a status code 13 in 10% of the requests.

JavaScript
const fault = {
  averageDelay: '50ms',
  statusCode: 10,
  errorRate: 0.1,
};