• English日本語한국어
  • Log inStart now

API examples for SLA reports

New Relic stores SLA data forever for eligible accounts, so you can use the New Relic REST API to generate service level agreement reports over any time period. For example, you can create SLA reports going back more than 12 days, weeks, or months.

Tip

Access to this feature depends on your subscription level.

Browser metrics for SLAs

Browser metrics for the End user tier are available only if you have installed the agent.

Browser (End user tier)

SLA metric name:value (and formula)

Page Views thousands

EndUser : call_count

Load time sec

EndUser : average_response_time

Apdex

EndUser/Apdex : score

% Satisfied

EndUser/Apdex : s divided by EndUser : call_count

% Tolerating

EndUser/Apdex : t divided by Enduser : call_count

% Frustrated

EndUser/Apdex : f divided by Enduser : call_count

App server metrics for SLAs

Here are the SLA metrics for application servers.

App server

SLA metric name:value (and formula)

Requests millions

HttpDispatcher : call_count (scaled appropriately)

Resp. time ms

HttpDispatcher : average_response_time (multiplied by 1000)

Apdex

Apdex : score

% Satisfied

Apdex : s divided by Apdex : count

% Tolerating

Apdex : t divided by Apdex : count

% Frustrated

Apdex : f divided by Apdex : count

Tips for collecting metrics

Here are some tips for planning which metrics to collect.

SLA tips

Comments

Requirements

When using the cURL command examples, be sure to replace the placeholder text with your account ID, an API key, and the application ID.

Time ranges

You are not limited to standard day, week, or month time ranges. For example, you can extract metric data for a "holiday weekend" from 12/23 to 12/26 or "the 20 minutes after our site had problems" or whatever other period interests you.

UTC XML time format

You must specify the time in UTC XML format, so be sure to adjust for your time zone compared to UTC. For example, New Relic starts at 16:00:00 on the day before the selected data, since New Relic headquarters are in UTC-8.

Summary reports

When requesting metrics to use with summary reports, include the query string parameter summarize=true (v2) or summary=1 (v1) as shown in the examples.

Scaled statistics

Your report has some statistics that are scaled in the SLA reports in New Relic's user interface. New Relic changes the scale of page views in your report to show small numbers. Depending on your traffic, typically it might be displayed in thousands, millions, or billions.

Recommendation: To avoid a string of zeroes, divide this number appropriately for your own purposes.

End user statistics

End user statistics will reflect only the calls in which the agent gathered browser data. For example, end user stats may not appear in situations such as:

  • Browser types

  • Clients (they might have disabled the JavaScript agent, or blocked traffic to New Relic sites for JavaScript code's location

  • Transactions not in one of those categories, in case the page load did not complete for any reason

    This is why there are fewer (sometimes many fewer) page views in the End User (browser) data section than in the App server data section.

Examples

The following sections contain code examples to acquire the data for values described above for the Daily (24hr) SLA statistics in the default GMT/UTC time zone. Adjust the from= and to= for your time range as desired.

There are syntactical differences between New Relic's REST API v2 and v1. The examples show how to use each.

REST API v2 commands

REST API v1 commands (deprecated)

REST API v1 is deprecated.

Analyze your data

APM includes several reports in the user interface. To gather, analyze, and visualize data about your software in other formats, use dashboards.

Copyright © 2024 New Relic Inc.

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