cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

manual tracking of errors

jakub.vagner2
Builder

Hello,

 I am trying to send custom error into AD from the web page .. how should I do that? more precisely, where should such error appear?

 

we have both javascript and ajax error tracking enabled and we're tracking only the virtual pages (no tracking of pages) .. I send the error as described here .. I see in the dev console, that data for the error are sent into AD, but I am not able to locate them in page/browser snapshot screen ..  I've tried version with and without line number, but the result is the same ..

 

 var adObject = new ADRUM.events.Error( {
        msg: "error text",
        line: 1 
    });
    ADRUM.report(adObject);

where should they be? 

 

thanks, 

 J.

6 REPLIES 6

Amit.Jha
AppDynamics Team (Retired)

Can you try assigning url property to adrumError? 
This should then report error under that requested URL in controller UI. Please refer below sample:

var errorT = new ADRUM.events.Error();
errorT.msg('I am a custom error at line 100');
errorT.line(100);
errorT.url('http://localhost:8080/myvirtualpage1')
ADRUM.report(errorT); 

 

Hi

 I've tried, but the result is the same .. I can see the url in the object passed into ADRUM.report (screenshot 11:04), but the data sent into AD looks the same (screenshot 10:55)

Mayuresh.Kshirsagar
AppDynamics Team (Retired)

Hi Jakub,

 

Can you please try providing the parent to the error object and see if it helps? Something like:

		var ajaxT = new ADRUM.events.Ajax();
		   
		// set url
		ajaxT.url('something loaded');
		   
		// mark timings
		ajaxT.markSendTime(100);
		ajaxT.markFirstByteTime(200);
		ajaxT.markRespAvailTime(300);
		ajaxT.markRespProcTime(400);
		
		var errorm = new ADRUM.events.Error();
		errorm.msg("test message123");
		errorm.line(10);
		errorm.parent(ajaxT);
		ADRUM.report(errorm);

Regards,

Mayuresh

in our case, we have disabled tracking of base pages (we have single page application in React, and I've learned that they would duplicate the hits for the virtualPages) .. 

 

 

 what should I set into the parent then? the old VirtualPage, which might/might not be already 'ended and reported'? or should I create new VirtualPage? but that would probably create new vPage hit, right? or maybe it wont count as hit, but only as browser snapshot?

 

function report(url, msg) {
 const vPageView = new ADRUM.events.VPageView({url: url});
 vPageView.start();

 var errorm = new ADRUM.events.Error();
 errorm.msg(msg);
 errorm.parent(vPageView);
 ADRUM.report(errorm);

 vPageView.end();
 ADRUM.report(vPageView);
}

 

you also written in different topic that 

 

When you create a new tracker, it will be a different session being reported, hence it wont build on the old in-complete session.

so each time I call new ADRUM.events.VPageView I am creating new session? how should we than track the navigation through multiple virtual pages? by reusing the same VPageView and sets it url and report it again? that would be great to have it written in the documentation :)

 

I'm facing the same issue. On the docs there is no reference that we should be sending the url or the parent.

In fact, the docs do not even indicate what is mandatory and what is optional.

Using manual reporting on a reactjs app, the ONLY thing I've been able to succesfully report is the VirtualPages.

Neither errors or http calls are being analyzed by the dashboard. Yet the api does not return any error or useful information.

Please advise!

Hi Santiago,

 

Thanks for bringing this up. I'll raise this internally to get the docs enhanced. url would be mandatory as the page naming will depend on it. parent is not mandatory. We would need to look at the har file to see what might be happening since it is not reporting errors or http calls. Just to confirm, the error and http calls are being made through the JS APIs?

 

Thanks,

Mayuresh