Skip to main content

New Relic

The Blameless platform offers integration with New Relic that allows you to monitor metrics that can be consumed within the SLO module.

Getting Started

The New Relic SLO integration adds a new APM integration to our SLO integrations suite. Blameless uses the following areas of the New Relic API specifically:

Create and Copy the Blameless API Client token

First, you need to create and copy an API token. Refer to the New Relic site for more information regarding their APIs.

Create the Blameless API Client token

note

When you create the New Relic API key, the key needs to be a User key.

  1. Select "Account Settings" in the upper right corner of the New Relic Home Page. A drop-down option list appears.
  2. Select "API Keys" under the Integrations section on the left nav bar.
  3. Click on the "Create REST API key".
  4. Click on "Show" and copy the REST API key provided.

Activate the New Relic Integration

  1. Open or switch windows to the Blameless application.
  2. Select the “Settings” (gear) icon.
  3. Select the “Integrations” option, then the “Metrics” suboption.
  4. Click on the “Manage” button associated with the “New Relic” row to select the "New Relic" app from the Integration list.
  5. Select the "Enable New Relic" slider to activate it.
NR Integration (NRQL Manage)

Copy the Blameless API Client token

  1. Scroll down to the New Relic API token field.
  2. Paste the copied New Relic API key in the text field.
  3. Click the “Save” button.
NR Integration (NRQL)

New Relic Query Language (NRQL)

SLIs created in Blameless’ SLO Manager, and fed from New Relic metrics are built using the New Relic Query Language (NRQL)--allowing a broad and flexible support for the versatile New Relic metric types (APM, Synthetics, etc.), across all SLI types (Availability, Latency, Throughput, and Saturation).

note

With NRQL, Blameless supports, as part of the Integration and SLO Manager features all SLI types.

More information regarding NRQL is available here.

Confirming the Integration

note

To test and confirm the integration, you need to have at least one service created within the Service Registry (instructions on how to appear in the previous section).

  1. Select the SLO portal icon (target) on the Blameless web application navigation menu.
  2. Create and define an SLO in the Blameless web application.
  3. Click on the “New Relic” button under the Select Data Source label to choose “New Relic” "as the datasource.
  4. Click on the “SLI Type” button. Copy and paste the desired metric in the required field.
  5. Complete the steps to create the SLO and click the “Save” button.

New Relic Examples

  1. Select an SLI type. a. If you choose “Availability”, select the following metric examples: Good metric: SELECT count(*)-sum(error) FROM TransactionValid metric: SELECT count(*) FROM Transaction b. If you choose “Latency”, select the following example: SELECT average(duration) FROM Span c. If you choose “Throughput”, select the following example:: SELECT count(*) FROM Transaction d. If you choose “Saturation”, select the following example: SELECT average(apm.service.cpu.usertime.utilization) FROM Metric WHERE appName LIKE '%'
NR Integration (NRQL)

If the query is valid and satisfies the requirements, you should see a green checkmark.

note

Query results should be in “timeseries” format and contain not more than one column. Columns are a measurable entity. The core of SLI is a metric, which we want to store, observe, and control (through SLO).

note

“Timeseries” is a special data format, where one column is the time point, another column is value. Refer to the Wikipedia definition for more information.

important

The query shouldn’t contain the keywords “SINCE” and “TIMESERIES” as we add them from the Blameless side. We have a validation function for avoiding bad user experience. Refer to the following examples:

Example: Error using the “SINCE” keyword

Query: SELECT average(apm.service.cpu.usertime.utilization) FROM Metric WHERE appName LIKE '%' SINCE 30 MINUTES

When you run the query, the Blameless Validation engine will throw the following error message:

Error: NRQL Syntax Error: Error at line 1 position 108, unexpected 'SINCE': error while querying metrics from New Relic

NR Integration (NRQL)
Example: Error using the “TIMESERIES” keyword

Query: SELECT average(apm.service.cpu.usertime.utilization) FROM Metric WHERE appName LIKE '%' TIMESERIES

When you run the query, the Blameless Validation engine will throw the following error message because of the use of the “TIMESERIES” keyword:

Error: Please do not include TIMESERIES clause, we'll add it when querying data

NR Integration (NRQL)
Example: Error using more than on column

Query: SELECT average(apm.service.cpu.usertime.utilization), average(apm.service.memory.physical) FROM Metric WHERE appName LIKE '%'

When you run the query, the Blameless Validation engine will throw the following error message because of the use more than one column value in the query:

apm.service.cpu.usertime.utilization apm.service.memory.physical The result is:

Error: wrong New Relic query, expected 1 element

NR Integration (NRQL)