Menu
Scroll for more
This is documentation for the next version of Grafana k6 documentation. For the latest stable release, go to the latest version.
Documentation
Grafana k6
Testing guides
Injecting faults with xk6-disruptor
xk6-disruptor API
ServiceDisruptor
Constructor
Open source
Constructor
The ServiceDisruptor() constructor creates a new instance of a
ServiceDisruptor class.
| Parameter | Type | Description |
|---|---|---|
| service | string | name of the service |
| namespace | string | namespace on which the service is defined |
| options (optional) | object | options for controlling the behavior of the disruptor |
Options
The following options control the creation and behavior of the ServiceDisruptor:
| Attribute | Type | Description |
|---|---|---|
| injectTimeout | string | maximum time for waiting the disruptor to be ready in the target pods (default 30s) |
Example
JavaScript
const disruptor = new ServiceDisruptor('my-service', 'my-namespace');Was this page helpful?
Related resources from Grafana Labs
Additional helpful documentation, links, and articles:
Video

Performance testing and observability in Grafana Cloud
Optimize user experiences with Grafana Cloud. Learn real-time insights, performance testing with k6, and continuous validation with Synthetic Monitoring.
Events

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.