• Log inStart now

Service level management: Questions and next steps

What permissions do I need to use New Relic's service levels?

Permission-related requirements for using New Relic service level management:

If you get the following errors, check your user permissions:

  • The UI has disabled the option to save an SLI/SLO.
  • The API returns the error message “Cannot query field \"eventExportRegisterRule\" on type \"RootMutationType\".”.

Why don't I see any data right after I create an SLI?

New Relic starts generating new SLI metrics from the moment that you create an SLI. This is why we need a few minutes before we can start showing the first meaningful SLI attainment results.

The benefit of the new data is that it has 13 month retention by default, and it’s more efficient to query for long periods of time.

Can I configure an SLI on any entity type?

Yes, you can configure an SLI on any entity type, such as an APM service, a browser application, or a Lambda function.

SLI queries support NRDB events and dimensional metrics.

What aggregation functions are supported?

At the moment the two aggregation functions that we support are count() and sum(). The count() function is recommended to be used with event data, when you just count the number of valid/good/bad events, while sum() would be helpful if you have pre-aggregated counters in event data or dimensional metrics.

Example using count():

FROM: JavaScriptError
SELECT count(*)
WHERE: entityGuid = '{entityGuid}' AND firstErrorInSession IS true

Example using sum():

FROM ServerlessSample
SELECT sum(provider.errors.Sum)
WHERE awsAccountId = 'XXX' And provider LIKE 'LambdaFunction%'

How can I query the percentage of a dimensional metric?

Here’s an example of the percentage-based success rate, let’s convert it into the valid/good events for SLI:

FROM Metric
SELECT percentage(sum(scrooge_do_expire_count),
WHERE status = 'success') AS 'Success Rate'
WHERE env='production'
AND status != 'attempt'

For the valid queries we would just copy the outside WHERE clause:

FROM Metric
SELECT sum(scrooge_do_expire_count))
WHERE env='production'
AND status != 'attempt'

While the good event would be the outside WHERE clause and WHERE clause from the percentage function:

FROM Metric
SELECT sum(scrooge_do_expire_count))
WHERE env='production'
AND status != 'attempt'
AND status = 'success'

How does New Relic calculate the remaining error budget?

The remaining error budget indicates what percentage of requests could still have a bad response over the SLO period without compromising the objective. Therefore, the total amount of tolerated bad responses will vary with the throughput of requests.

How can I view the queries that define an SLI from the UI?

To view the queries that define an SLI, you can click on the ... menu on the SLI row, then select the Edit option. The queries will show at the top-right corner.

You can also find them through the summary page, by clicking Edit.

How can I view the queries that define an SLI through the API?

To view the queries that define an SLI through the API, use Nerdgraph. In order to view the SLI configuration, you'll need to know the GUID of the entity the SLI is attached to, and replace it in the following query:

{
actor {
entity(guid: "{entityGuid}") {
serviceLevel {
indicators {
events {
badEvents {
where
from
}
goodEvents {
from
where
}
validEvents {
from
where
}
}
name
}
}
}
}
}

As a response you are going to receive all the SLIs attached to the entity, the SLI name, and the queries. Keep in mind that either goodEvents or badEvents is going to have content, depending on the configuration of the SLI.

Can I chart the SLI attainment on a dashboard?

You can chart SLI attainment time series on your custom dashboards using the following query:

FROM Metric SELECT clamp_max((count(newrelic.sli.valid) - count(newrelic.sli.bad)) / count(newrelic.sli.valid) * 100, 100) AS 'SLI attainment' WHERE sli.id = '<sli.id>' UNTIL 2 MINUTES AGO TIMESERIES AUTO

Where sli.id is the SLI identifier. The easiest way to add a chart like this to your dashboard is by using the Add to dashboard option, available on the Details view.

Alternatively, you can find the SLI id and SLI attainment query through the Nerdgraph API with the following query:

{
actor {
entity(guid: "{entityGuid}") {
serviceLevel {
indicators {
name
id
resultQueries {
indicator {
nrql
}
}
}
}
}
}
}

Use the entityGuid of the entity that's associated with the SLI. On the query results, you’ll get the SLI id in the serviceLevel.indicators.id field.

Why do the SLO periods only include complete weeks?

SLO compliance results for rolling time windows are more consistent when they include complete weeks. This way, the calculation always includes the same amount of weekends, and any weekly seasonality doesn't impact the results depending on which day of the week you look at SLOs.

How many SLIs can I create on an account?

You can create a maximum of 500 SLIs on an account.

How can I learn best practices for setting up and using SLM?

For some tips on SLM, see our observability maturity guide on optimizing SLM.

Copyright © 2022 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.