Question

My website has an element that is updated by some javascript that loads asynchronously, so this element's ready time is not tied to either DOMReady or window.onLoad. Is there any way to tell New Relic to track this specific element's onReady event?

The New Relic documentation mentions a function called inlineHit() that should be able to do this: https://docs.newrelic.com/docs/new-relic-browser/manually-reporting-page-load-timing-data

However, I tried firing this function via a browser console, like so:

NREUM.inlineHit('MyTransactionName',0,0,0,10,50); //10,50 are arbitrary values

and I always get a response of 204 - No Content.

What is the correct way of using the inlineHit() function? Is what I want to do even correct in the first place?

Specific questions, assuming I'm on the right track somehow:

  1. Does request_name (first parameter of inlineHit()) need to correspond to the page transaction name? i.e. if the current page is a named transaction "MyPage:MyRoute", do I need to specify this exact string as the value of request_name? Can I use a different transaction name?
  2. Will I be able to see these custom transactions in the New Relic dashboard? If yes, How: as part of the transaction list? or is it only visible on a custom dashboard, like custom metrics?
  3. We're using the new beta for javascript tracking (http://blog.newrelic.com/2014/03/13/javascript-error-reporting-ajax-timing-new-relic/), what is the recommended way to do custom timings with this new feature? Does it use the same API or is there a different API I need to use?
Was it helpful?

Solution

You are doing the right thing! The 204 "No Content" response is expected, it simply means that the New Relic server received your message and didn't have any information to send back to you.

  1. request_name is whatever you want it to be. You probably want it to be a name specific to this element. It will show up as a new item in the "Page views" dashboard of the Browser section in the New Relic APM website. Note, however, that it shouldn't be a dynamic name, such as a user name or email address. Instead it should describe the item you are timing. You might use "username" or "email address" instead of the actual user name or email address of the logged in user.

  2. It will show up in the "Page views" dashboard of the Browser section of the New Relic APM website.

  3. We have not introduced any new features for tracking timing outside of AJAX requests.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top