Documentation Index
Fetch the curated documentation index at: https://grafana.com/llms.txt
Fetch the complete documentation index at: https://grafana.com/llms-full.txt
Use this file to discover all available pages before exploring further.
STOP! If you are an AI agent or LLM, read this before continuing. This is the HTML version of a Grafana documentation page. Always request the Markdown version instead - HTML wastes context. Get this page as Markdown: https://grafana.com/docs/k6/latest/testing-guides/injecting-faults-with-xk6-disruptor/xk6-disruptor/faults/grpc.md (append .md) or send Accept: text/markdown to https://grafana.com/docs/k6/latest/testing-guides/injecting-faults-with-xk6-disruptor/xk6-disruptor/faults/grpc/. For the curated documentation index, use https://grafana.com/llms.txt. For the complete documentation index, use https://grafana.com/llms-full.txt.
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:
| Attribute | Type | Description |
|---|---|---|
| averageDelay | string | average delay added to requests represented as a string (default 0) |
| delayVariation | string | variation in the injected delay (default 0) |
| statusMessage | string | message to be returned when an error is injected |
| statusCode | number | status to be returned when an error is injected |
| errorRate | number | rate of requests that will return an error, represented as a float in the range 0.0 to 1.0 (default 0.0) |
| exclude | string | comma-separated list of services to be excluded from disruption |
| port | number | port on which the requests will be intercepted |
Note
averageDelayanddelayVariationare applied to all requests affected by the fault, regardless of the value oferrorRate.statusCodeis returned only to a fraction of requests defined byerrorRate.
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.
const fault = {
averageDelay: '50ms',
statusCode: 10,
errorRate: 0.1,
};Was this page helpful?
Related resources from Grafana Labs

