Your data. Anywhere you go.

New Relic for iOS or Android


Download on the App Store    Android App on Google play


New Relic Insights App for iOS


Download on the App Store


Learn more

Close icon

REST API requests for non-existent data response is changing. No more 404s

404
missing
non-existent
data
api

#1

Currently, making requests for metric names that do not exist will result in one of two responses:

  • If some or all of the metric names exist, the metric data for those that are found is returned.
  • If none of the metric names exist, a 404 status will be returned.

This response is planned to change on March 1st.

After the change a successful response will include

  1. a 200 status code,
  2. metadata containing the names of the metrics requested
  3. status of the request for those names

Note: a successful response may not return metric data.


The details:

The previous 404 status when no metric name matches are found has been eliminated. In it’s place metadata will now be provided listing all the metric names requested and their status. Two categories will be provided, “metrics_not_found” and “metrics_found”. The meta data and their meaning is explained below


Response Metadata:
“metrics_not_found”
Description:
Lists all metric names for which matching data was not found in the requested time period.
Response metric data:
Metric data will not be returned for these metrics


Response Metadata:
“metrics_found”
Description:
Lists all metric names for which matching data was found in the requested time period.
Response metric data:
Metric data will be returned for these metrics`


In lieu of the previous 404, if no metric names are found then “metrics_found” will be empty.

The following is an example of output for a valid metric name, “HttpDispatcher”.

HTTP/1.1 200 OK
etag: "0dc87c63d8dff6b1a9714bdf7531ec09"
Content-Type: application/json
cache-control: max-age=0, private, must-revalidate
{
  "metric_data": {
    "from": "2016-01-28T18:06:06+00:00",
    "to": "2016-01-28T18:36:06+00:00",
    "metrics_not_found": [], <---<<< INDICATES NO INVALID METRIC NAMES REQUESTED
    "metrics_found": [
      "HttpDispatcher"       <---<<< INDICATES THIS METRIC NAME WAS VALID
    ],
    "metrics": [             <---<<< DATA RETURNED
      {
        "name": "HttpDispatcher",
        "timeslices": [
          {
            "from": "2016-01-28T18:03:00+00:00",
            "to": "2016-01-28T18:04:00+00:00",
            "values": {
              "average_response_time": 364,
              "calls_per_minute": 99800,
              "call_count": 99770,
              "min_response_time": 3.5,
              "max_response_time": 85000,
              "average_exclusive_time": 0,
              "average_value": 0.364,
              "total_call_time_per_minute": 36300,
              "requests_per_minute": 99800,
              "standard_deviation": 1900,
              "average_call_time": 364
            ...

The following is an example of output for a invalid metric name, “Foo”.

HTTP/1.1 200 OK
etag: "e51782cf7c5a5596139a7f5340c3de23"
Content-Type: application/json
cache-control: max-age=0, private, must-revalidate
{
  "metric_data": {
    "from": "2016-01-28T18:06:33+00:00",
    "to": "2016-01-28T18:36:33+00:00",
    "metrics_not_found": [
      "Foo"                   <---<<< INDICATES THIS METRIC NAME WAS INVALID
    ],
    "metrics_found": [],      <---<<< INDICATES NO VALID METRIC NAMES FOUND
    "metrics": []             <---<<< NO DATA RETURNED
  }
}

pinned #2