<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Faults on Grafana Labs</title><link>https://grafana.com/docs/k6/v2.3.x/testing-guides/injecting-faults-with-xk6-disruptor/xk6-disruptor/faults/</link><description>Recent content in Faults on Grafana Labs</description><generator>Hugo -- gohugo.io</generator><language>en</language><atom:link href="/docs/k6/v2.3.x/testing-guides/injecting-faults-with-xk6-disruptor/xk6-disruptor/faults/index.xml" rel="self" type="application/rss+xml"/><item><title>gRPC</title><link>https://grafana.com/docs/k6/v2.3.x/testing-guides/injecting-faults-with-xk6-disruptor/xk6-disruptor/faults/grpc/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/testing-guides/injecting-faults-with-xk6-disruptor/xk6-disruptor/faults/grpc/</guid><content><![CDATA[&lt;h1 id=&#34;grpc&#34;&gt;gRPC&lt;/h1&gt;
&lt;p&gt;A gRPC Fault describes the characteristics of the faults to be injected in the gRPC requests served by a target.&lt;/p&gt;
&lt;p&gt;A gRPC fault is described by the following attributes:&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Attribute&lt;/th&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;averageDelay&lt;/td&gt;
              &lt;td&gt;string&lt;/td&gt;
              &lt;td&gt;average delay added to requests represented as a string (default &lt;code&gt;0&lt;/code&gt;)&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;delayVariation&lt;/td&gt;
              &lt;td&gt;string&lt;/td&gt;
              &lt;td&gt;variation in the injected delay (default &lt;code&gt;0&lt;/code&gt;)&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;statusMessage&lt;/td&gt;
              &lt;td&gt;string&lt;/td&gt;
              &lt;td&gt;message to be returned when an error is injected&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;statusCode&lt;/td&gt;
              &lt;td&gt;number&lt;/td&gt;
              &lt;td&gt;status to be returned when an error is injected&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;errorRate&lt;/td&gt;
              &lt;td&gt;number&lt;/td&gt;
              &lt;td&gt;rate of requests that will return an error, represented as a float in the range &lt;code&gt;0.0&lt;/code&gt; to &lt;code&gt;1.0&lt;/code&gt; (default &lt;code&gt;0.0&lt;/code&gt;)&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;exclude&lt;/td&gt;
              &lt;td&gt;string&lt;/td&gt;
              &lt;td&gt;comma-separated list of services to be excluded from disruption&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;port&lt;/td&gt;
              &lt;td&gt;number&lt;/td&gt;
              &lt;td&gt;port on which the requests will be intercepted&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;

&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;&lt;code&gt;averageDelay&lt;/code&gt; and &lt;code&gt;delayVariation&lt;/code&gt; are applied to all requests affected by the fault, regardless of the value of &lt;code&gt;errorRate&lt;/code&gt;. &lt;code&gt;statusCode&lt;/code&gt; is returned only to a fraction of requests defined by &lt;code&gt;errorRate&lt;/code&gt;.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h2 id=&#34;example&#34;&gt;Example&lt;/h2&gt;
&lt;p&gt;This example defines a gRPC fault that introduces a delay of &lt;code&gt;50ms&lt;/code&gt; in all requests and returns a status code &lt;code&gt;13&lt;/code&gt; in &lt;code&gt;10%&lt;/code&gt; of the requests.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JavaScript&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-javascript&#34;&gt;const fault = {
  averageDelay: &amp;#39;50ms&amp;#39;,
  statusCode: 10,
  errorRate: 0.1,
};&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
]]></content><description>&lt;h1 id="grpc">gRPC&lt;/h1>
&lt;p>A gRPC Fault describes the characteristics of the faults to be injected in the gRPC requests served by a target.&lt;/p>
&lt;p>A gRPC fault is described by the following attributes:&lt;/p></description></item><item><title>HTTP</title><link>https://grafana.com/docs/k6/v2.3.x/testing-guides/injecting-faults-with-xk6-disruptor/xk6-disruptor/faults/http/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/testing-guides/injecting-faults-with-xk6-disruptor/xk6-disruptor/faults/http/</guid><content><![CDATA[&lt;h1 id=&#34;http&#34;&gt;HTTP&lt;/h1&gt;
&lt;p&gt;A HTTP Fault describes the characteristics of the faults to be injected in the HTTP requests served by a target.&lt;/p&gt;
&lt;p&gt;A HTTP fault is described by the following attributes:&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Attribute&lt;/th&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;averageDelay&lt;/td&gt;
              &lt;td&gt;string&lt;/td&gt;
              &lt;td&gt;average delay added to requests represented as a string (default &lt;code&gt;0&lt;/code&gt;)&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;delayVariation&lt;/td&gt;
              &lt;td&gt;string&lt;/td&gt;
              &lt;td&gt;variation in the injected delay (default &lt;code&gt;0&lt;/code&gt;)&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;errorBody&lt;/td&gt;
              &lt;td&gt;string&lt;/td&gt;
              &lt;td&gt;body to be returned when an error is injected&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;errorCode&lt;/td&gt;
              &lt;td&gt;number&lt;/td&gt;
              &lt;td&gt;error code to return&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;errorRate&lt;/td&gt;
              &lt;td&gt;number&lt;/td&gt;
              &lt;td&gt;rate of requests that will return an error, represented as a float in the range &lt;code&gt;0.0&lt;/code&gt; to &lt;code&gt;1.0&lt;/code&gt; (default &lt;code&gt;0.0&lt;/code&gt;)&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;exclude&lt;/td&gt;
              &lt;td&gt;string&lt;/td&gt;
              &lt;td&gt;comma-separated list of urls to be excluded from disruption (e.g. /health)&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;port&lt;/td&gt;
              &lt;td&gt;number&lt;/td&gt;
              &lt;td&gt;port on which the requests will be intercepted&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;

&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;&lt;code&gt;averageDelay&lt;/code&gt; and &lt;code&gt;delayVariation&lt;/code&gt; are applied to all requests affected by the fault, regardless of the value of &lt;code&gt;errorRate&lt;/code&gt;. &lt;code&gt;errorCode&lt;/code&gt; is returned only to a fraction of requests defined by &lt;code&gt;errorRate&lt;/code&gt;.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h2 id=&#34;example&#34;&gt;Example&lt;/h2&gt;
&lt;p&gt;This example defines a HTTP fault that introduces a delay of &lt;code&gt;50ms&lt;/code&gt; in all requests and returns an error code &lt;code&gt;500&lt;/code&gt; in &lt;code&gt;10%&lt;/code&gt; of the requests.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JavaScript&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-javascript&#34;&gt;const fault = {
  averageDelay: &amp;#39;50ms&amp;#39;,
  errorCde: 500,
  errorRate: 0.1,
};&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
]]></content><description>&lt;h1 id="http">HTTP&lt;/h1>
&lt;p>A HTTP Fault describes the characteristics of the faults to be injected in the HTTP requests served by a target.&lt;/p>
&lt;p>A HTTP fault is described by the following attributes:&lt;/p></description></item><item><title>Pod Termination</title><link>https://grafana.com/docs/k6/v2.3.x/testing-guides/injecting-faults-with-xk6-disruptor/xk6-disruptor/faults/pod-termination/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/testing-guides/injecting-faults-with-xk6-disruptor/xk6-disruptor/faults/pod-termination/</guid><content><![CDATA[&lt;h1 id=&#34;pod-termination&#34;&gt;Pod Termination&lt;/h1&gt;
&lt;p&gt;A Pod Termination Fault allows terminating either a fixed number or a percentage of the pods that matching a selector or back a service.&lt;/p&gt;
&lt;p&gt;A Pod Termination fault is defined by the following attributes:&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Attribute&lt;/th&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;count&lt;/td&gt;
              &lt;td&gt;integer or percentage&lt;/td&gt;
              &lt;td&gt;the number of pods to be terminated. It can be specified as a integer number or as a percentage, for example &lt;code&gt;30%&lt;/code&gt;, that defines the fraction of target pods to be terminated&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;

&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;If the count is a percentage and there are no enough elements in the target pod list, the number is rounded up.
For example &amp;lsquo;25%&amp;rsquo; of a list of 2 target pods will terminate one pod.
If the list of target pods is not empty, at least one pod is always terminated.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h2 id=&#34;example&#34;&gt;Example&lt;/h2&gt;
&lt;p&gt;This example defines a PorTermination fault that will terminate &lt;code&gt;30%&lt;/code&gt; of target pods&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JavaScript&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-javascript&#34;&gt;const fault = {
  count: &amp;#39;30%&amp;#39;,
};&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
]]></content><description>&lt;h1 id="pod-termination">Pod Termination&lt;/h1>
&lt;p>A Pod Termination Fault allows terminating either a fixed number or a percentage of the pods that matching a selector or back a service.&lt;/p></description></item></channel></rss>