Menu
DocumentationGrafana k6Testing guidesInjecting faults with xk6-disruptorxk6-disruptor APIServiceDisruptorinjectGrpcFaults
Open source
injectGrpcFaults
injectGrpcFaults injects gRPC faults in the requests served by a target Service.
Parameters | Type | Description |
---|---|---|
fault | object | description of the gRPC faults to be injected |
duration | string | duration of the disruption |
options (optional) | object | options that control the injection of the fault |
Options
The injection of the fault is controlled by the following options:
Option | Type | Description |
---|---|---|
proxyPort | number | port the agent will use to listen for requests in the target pods ( default 8000 ) |
Example
JavaScript
const fault = {
averageDelay: '50ms',
statusCode: 13,
errorRate: 0.1,
};
disruptor.injectGrpcFaults(fault, '30s');
Was this page helpful?
Related documentation
Related resources from Grafana Labs
Additional helpful documentation, links, and articles:
Video
Performance testing and observability in Grafana Cloud
In this webinar, learn how Grafana Cloud k6 offers you the best developer experience for performance testing.
User-centered observability: load testing, real user monitoring, and synthetics
Learn how to use load testing, synthetic monitoring, and real user monitoring (RUM) to understand end users' experience of your apps. Watch on demand.