We use cookies or similar technologies to personalize your online experience & tailor marketing to you. Many of our product features require cookies to function properly.

Read our privacy policy I accept cookies from this site

SLI Cookbook

This section presents a few examples of different types of criteria and qualifiers.

No qualifier  🔗

For all events, return true if duration_ms < 1000.

LT($duration_ms, 1000)

Qualifier is trace roots  🔗

A trace root does not have a parent. This SLI returns true for trace roots whose response duration is under 100, false for trace roots whose duration is over 100, and null for non-roots.

		LT($duration_ms, 100)

Criterion is based on both duration and error  🔗

Our qualifier here is whether request.path is /home. If it is, then this SLI only returns true if both duration_ms is under 100, and there is no error message.

	EQUALS($request.path, “/home” ),
      LT($duration_ms, 100),

Complex criterion, complex qualifier  🔗

The qualifier here is events that hit the “/main” endpoint, using the method post, and are not marked as error code 401.

The criterion is that events must have a status code of 200. In addition, if they are part of a batch, then data processing must have taken less than 5 ms per item.

    EQUALS($request.path, "main"),
    EQUALS($request.method, "POST"),
    NOT(EQUALS($response.status_code, 401))
     EQUALS($response.status_code, 200),
      IF($app.batch, $app.batch_total_datapoints, 5)
    ), 5)