Menu
Open source
How xk6-disruptor works
xk6-disruptor consists of two main components:
- The xk6-disruptor extension provides a Javascript API for injecting faults into a target system using the xk6-disruptor-agent as a backend. This API is built around a collection of disruptors. Each disruptor targets a type of component in the system (for example Pods or cluster Nodes).
- The xk6-disruptor-agent injects faults into the target system where it runs. It is provided as an Docker image that you can pull from the xk6-disruptor repository.
The xk6-disruptor extension installs the agent in the target and sends commands to inject the desired faults. How this happens depends on the type of disruptor, as described in the following sections.
PodDisruptor
The following diagram shows how PodDisruptor works:
- The PodDisruptor selects the target pods based on the selector attributes defined in the constructor
- The PodDisruptor attaches the xk6-disruptor-agent to each of the target pods
- When a fault is injected (e.g. calling the injectHTTTFault) the PodDisruptor sends a command to the agents to inject the fault in their respective pods
ServiceDisruptor
The ServiceDisruptor works as a wrapper around a PodDisruptor, which targets the pods that back the service.
- The ServiceDisruptor uses the definition of the service specified in the constructor to create a pod selector that matches the pods that back the service.
- The ServiceDisruptor creates a PodDisruptor using this pod selector.
- The PodDisruptor installs the agent in the target pods.
From this point, the PodDisruptor works as described before.
Was this page helpful?
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.