From AjaxRequest I cannot see my body response when I got status code >= 400

Hey,

I doing the following call SELECT * from AjaxRequest WHERE httpResponseCode >= 500 SINCE 14 days ago

As a reponse I get

[
...
{
    "appId": 374942768,
    "appName": "backoffice-angular-stg",
    "asn": "9051",
    "asnLatitude": 33.873992919921875,
    "asnLongitude": 35.50889587402344,
    "asnOrganization": "IncoNet Data Management sal",
    "browserInteractionId": "27f76b1a-b4d4-4c30-b020-0cd6cb1bbe82",
    "browserInteractionName": "{PAGE_URL}:443/login",
    "city": "Beirut",
    "countryCode": "LB",
    "deviceType": "Desktop",
    "entityGuid": "MjY0NzQxMnxCUk9XU0VSfEFQUExJQ0FUSU9OfDM3NDk0Mjc2OA",
    "eventId": "4",
    "groupedPageUrl": "{PAGE_URL}:443",
    "groupedRequestUrl": "{HOSTNAME}:80/{PATH}",
    "hostname": "{HOSTNAME}",
    "httpMethod": "POST",
    "httpResponseCode": 500,
    "jsDuration": 0.13,
    "pageUrl": "https://{PAGE_URL}/",
    "parentEventId": "1",
    "port": 443,
    "regionCode": "04",
    "requestBodySize": 1178,
    "requestUrl": "{HOSTNAME}/{PATH}",
    "responseBodySize": 65,
    "timeSinceBrowserInteractionStart": 3.26,
    "timeToLastCallbackEnd": 2.352,
    "timeToLoadEventStart": 2.222,
    "timeToSettle": 2.352,
    "timestamp": 1622468407237,
    "userAgentName": "Safari",
    "userAgentOS": "Mac",
    "userAgentVersion": "14.0"
}
...
]

Can someone tell me where I can found this information? Because on the Mobile side I do found it under MobileRequestError

@edouard2 Hi there! Are you using an API call to get this information? You can find that data in the AjaxRequest event type and you can run this NRQL query in Query Builder.

If you toggle the chart to JSON, you can find all the data in the same format. See here as an example:

If that’s not what you are looking for, please let me know! Thank you again,

Hey cfrankenfield,

I think you did not understand my question.
I do see this all data except the bodyResponse, which means I cannot know what the error send by the API.
I can know only the API X did fail because the statusCode is set as 500.

Any suggestion to get this information?

Thanks
Edouard

@edouard2 Thank you for clarifying here. Can you please share what API call or curl command you are running to get that original response?

Are you using the REST API, Nerd Graph API or other?

I’d like to confirm your method first and then can see if this feature exists. If it does not, I’d be happy to open a feature idea request for the future. Thanks again.

Hey @cfrankenfield,

so I do use the interface query builder we do see on the new relic

Thanks
Edouard

@edouard2

Can you please share what API call or curl command you are running to get that original response you shared above? Are you using the REST API, Nerd Graph API or other?

If you are just using NRQL, and not seeing that feature attribute for bodyResponse, I’m happy to open a feature idea for you. Thank you,

Sorry @cfrankenfield I do not know what you are talking about API call or curl command.
I’m just using the web interface of newrelic.com and do an NRQL from the interface…

Here what I got from the response:
PS: I did keep all the field but I did hide some value!

I did just give you the first row but all of them does not show the bodyResponse

SELECT bodyResponse from AjaxRequest WHERE httpResponseCode >= 500 SINCE 14 days ago
Response:
{
  "results": [
    {
      "events": [
        {
          "timestamp": 1623327298726,
          "bodyResponse": null
        },
        {
          "timestamp": 1623313421308,
          "bodyResponse": null
        },
        {
          "timestamp": 1623267074894,
          "bodyResponse": null
        },
        {
          "timestamp": 1623245518048,
          "bodyResponse": null
        },
        {
          "timestamp": 1623165034111,
          "bodyResponse": null
        },
        {
          "timestamp": 1623164698245,
          "bodyResponse": null
        },
        {
          "timestamp": 1623164697118,
          "bodyResponse": null
        },
        {
          "timestamp": 1623163584103,
          "bodyResponse": null
        },
        {
          "timestamp": 1623161132046,
          "bodyResponse": null
        },
        {
          "timestamp": 1623159171917,
          "bodyResponse": null
        }
      ]
    }
  ],
  "metadata": {
    "contents": [
      {
        "function": "events",
        "limit": 10,
        "columns": [
          "timestamp",
          "bodyResponse"
        ],
        "order": {
          "column": "timestamp",
          "descending": true
        }
      }
    ],
    "eventTypes": [
      "AjaxRequest"
    ],
    "eventType": "AjaxRequest",
    "openEnded": true,
    "messages": [],
    "beginTimeMillis": 1622138219027,
    "endTimeMillis": 1623347819027,
    "beginTime": "2021-05-27T17:56:59Z",
    "endTime": "2021-06-10T17:56:59Z",
    "guid": "c404e060-2dca-5084-9d15-99c8aa436345",
    "routerGuid": "1299c5c9-d6f3-c1be-7815-87f4a7b9431c",
    "rawSince": "14 DAYS AGO",
    "rawUntil": "NOW",
    "rawCompareWith": ""
  },
  "performanceStats": {
    "inspectedCount": 4950,
    "responseTime": 39
  }
}

@edouard2 Thank you again. As we are not collecting bodyResponse as an attribute out of the box, I’ve reached out to our team here to create a feature idea on your behalf for this feature. Please let me know if there’s anything else you’d like to add here. Thank you!

1 Like