New Relic
New Relic is a software solution that monitors performance and availability. It sets and rates application performance across the environment using a standardized Apdex (application performance index) score. You can use any New Relic query to gather SLIs and apply them in Nobl9 to define your new SLOs.
New Relic parameters and supported features in Nobl9
- General support:
- Release channel: Stable, Beta
- Connection method: Agent, Direct
- Replay and SLI Analyzer: Historical data limit 30 days
- Event logs: Supported
- Query checker: Supported
- Query parameters retrieval: Supported
- Timestamp cache persistence: Supported
- Query parameters:
- Query interval: 1 min
- Query delay: 1 min
- Jitter: 15 sec
- Timeout: 30 sec
- Agent details and minimum required versions for supported features:
- Plugin name: n9newrelic
- Query delay environment variable: NR_QUERY_DELAY
- Replay and SLI Analyzer: 0.65.0
- Query parameters retrieval: 0.73.2
- Timestamp cache persistence: 0.65.0
- Additional notes:
- Support for New Relic queries
- Learn more
Creating SLOs with New Relicβ
Nobl9 Webβ
Follow the instructions below to create your SLOs with New Relic in the UI:
-
Navigate to Service Level Objectives.
-
Click .
-
Select a data source for your SLO.
-
In step 1 of the SLO wizard, select the service the SLO will be associated with.
-
Specify the Metric. You can choose either a Threshold Metric, where a single time series is evaluated against a threshold or a Ratio Metric, which allows you to enter two time series to compare (for example, a count of good requests and total requests).
- Choose the Data Count Method for your ratio metric:
- Non-incremental: counts incoming metric values one-by-one. So the resulting SLO graph is pike-shaped.
- Incremental: counts the incoming metric values incrementally, adding every next value to previous values.
It results in a constantly increasing SLO graph.
-
Use the New Relic's query language (NRQL) to enter a Query or a Good query and Total Query for the metric you selected. For more details on NRQL and query samples, refer to the New Relic query examples section.
- Nobl9 queries for time series data using the
TIMESERIES
clause.- You can add an empty
TIMESERIES
clause in your NRQL query or skip it altogether as Nobl9 adds missingTIMESERIES
clause or overwrites the existing one. - As
TIMESERIES
clause is overwritten, do not append it with custom parameters.
- You can add an empty
warningDo not append the time range by using the
SINCE
andUNTIL
clauses in your queries as Nobl9 must have control over queried time range.For details on the position of the
TIMESERIES
clause, go to New Relic query examples below. - Nobl9 queries for time series data using the
-
In step 3, define a Time Window for the SLO.
-
Rolling time windows are better for tracking the recent user experience of a service.
-
Calendar-aligned windows are best suited for SLOs that are intended to map to business metrics measured on a calendar-aligned basis, such as every calendar month or every quarter.
-
In step 4, specify the Error Budget Calculation Method and your Objective(s).
- Occurrences method counts good attempts against the count of total attempts.
- Time Slicesmethod measures how many good minutes were achieved (when a system operates within defined boundaries) during a time window.
- You can define up to 12 objectives for an SLO.
See the use case example and the SLO calculations guide for more information on the error budget calculation methods.
-
In step 5, add the Display name, Name, and other settings for your SLO:
- Create a composite SLO
- Set notification on data, if this option is available for your data source.
When activated, Nobl9 notifies you if your SLO hasn't received data or received incomplete data for more than 15 minutes. - Add alert policies, labels, and links, if required.
You can add up to 20 links per SLO.
-
Click Create SLO.
countMetrics
), keep in mind that the values ββresulting from that query for both good and total:- Must be positive.
- While we recommend using integers, fractions are also acceptable.
- If using fractions, we recommend them to be larger than
1e-4
=0.0001
. - Shouldn't be larger than
1e+20
.
sloctlβ
- Threshold (rawMetric)
- Ratio (countMetric)
apiVersion: n9/v1alpha
kind: SLO
metadata:
name: api-server-slo
displayName: API Server SLO
project: default
labels:
area:
- latency
- slow-check
env:
- prod
- dev
region:
- us
- eu
team:
- green
- sales
annotations:
area: latency
env: prod
region: us
team: sales
spec:
description: Example New Relic SLO
indicator:
metricSource:
name: new-relic
project: default
kind: Agent
budgetingMethod: Occurrences
objectives:
- displayName: Good response (200)
value: 200
name: ok
target: 0.95
rawMetric:
query:
newRelic:
nrql: select average(duration) from transaction timeseries
op: lte
primary: true
service: api-server
timeWindows:
- unit: Month
count: 1
isRolling: false
calendar:
startTime: 2022-12-01T00:00:00.000Z
timeZone: UTC
alertPolicies:
- fast-burn-5x-for-last-10m
attachments:
- url: https://docs.nobl9.com
displayName: Nobl9 Documentation
anomalyConfig:
noData:
alertMethods:
- name: slack-notification
project: default
apiVersion: n9/v1alpha
kind: SLO
metadata:
name: api-server-slo
displayName: API Server SLO
project: default
labels:
area:
- latency
- slow-check
env:
- prod
- dev
region:
- us
- eu
team:
- green
- sales
annotations:
area: latency
env: prod
region: us
team: sales
spec:
description: Example New Relic SLO
indicator:
metricSource:
name: new-relic
project: default
kind: Agent
budgetingMethod: Occurrences
objectives:
- displayName: Good response (200)
value: 1
name: ok
target: 0.95
countMetrics:
incremental: true
good:
newRelic:
nrql: >-
SELECT count(*) FROM Transaction WHERE httpResponseCode IN
('200','301','302') TIMESERIES
total:
newRelic:
nrql: SELECT count(*) FROM Transaction TIMESERIES
primary: true
service: api-server
timeWindows:
- unit: Month
count: 1
isRolling: false
calendar:
startTime: 2022-12-01T00:00:00.000Z
timeZone: UTC
alertPolicies:
- fast-burn-5x-for-last-10m
attachments:
- url: https://docs.nobl9.com
displayName: Nobl9 Documentation
anomalyConfig:
noData:
alertMethods:
- name: slack-notification
project: default
Specification for metric from New Relic always has one mandatory field:
nrql
β It can be used to retrieve detailed New Relic data and get insight into your applications, hosts, and business-important activity.
Query examplesβ
TIMESERIES
clauseNobl9 queries to New Relic are sensitive to the position of the TIMESERIES
clause. For example, to make the following correct NewRelic query work in Nobl9:
SELECT
count(*)
FROM
// highlight-next-line
Transaction TIMESERIES
WHERE
httpResponseCode IN ('301', '200', '302')
Move the TIMESERIES
clause to the end of your Nobl9 query:
SELECT
count(*)
FROM
Transaction
WHERE
// highlight-next-line
httpResponseCode IN ('301', '200', '302') TIMESERIES
The following are valid query examples:
-
TIMESERIES
clause:
SELECT count(*) FROM Transaction TIMESERIES 1 hour
1 hour
will be overwritten by the agent and set to a different value. -
Threshold metric for New Relic:
Query:SELECT average(duration) FROM Transaction TIMESERIES
-
Ratio metric for New Relic:
Good Query:SELECT count(*) FROM Transaction WHERE httpResponseCode IN ('200','301','302') TIMESERIES
Total Query:
SELECT count(*) FROM Transaction TIMESERIES
For details on New Relic Query Language, refer to the Introduction to NRQL | New Relic documentation.
One point in resultsβ
Queries must be written in such a way that they return only one time series. In other words, you must always query for a single attribute or use a single function (or expression).
Examples:
β Incorrect queries:
-
SELECT * FROM Transaction
- selects ALL attributes -
SELECT average(duration), min(duration) FROM Transaction
- selects two functions
β Correct queries:
-
SELECT count(*) FROM Transaction TIMESERIES
- selects a single function. -
SELECT average(duration) FROM Transaction TIMESERIES
- selects a single attribute.
Other clauses mutually exclusive with TIMESERIES
β Other clauses that are mutually exclusive with TIMESERIES
clause must not be used.
Example:
SELECT count(*) FROM PageView FACET city
Querying the New Relic serverβ
The Nobl9 agent leverages NewRelic Insights API parameters. It pulls data at a two-minute interval from the New Relic server.
New Relic API rate limitsβ
For the information on New Relic rate limits, refer to the following documentation: