Splunk AppDynamics

Example to enable AppDynamics EUM for Angular4 through manual reporting

CommunityUser
Splunk Employee
Splunk Employee

Hello,

I have an application developed with Angular4. I am trying to enable AppDynamics EUM using documentation.

According to the AppDynamics documentation you have mentioned that for Angular 2 and 4 need to report the events manually.

Here the listed below events that you mentioned in the documentation

  • start()
  • end()
  • startCorrelatingXhrs()
  • stopCorrelatingXhrs()
  • stopCorrelatingXhrs()
  • markVirtualPageEnd()
  • startCorrelatingXhrs()
  • stopCorrelatingXhrs()
  • markViewChangeStart()
  • markViewChangeEnd()
  • markViewDOMLoaded()
  • markXhrRequestsCompleted()
  • markViewResourcesLoaded()
  • markVirtualPageStart()
  • markVirtualPageEnd()

  

I got confused where to inject this above event whether in typescript or in JavaScript code.

Can you explain which place to call the above ADRUM Event API functions in application code?

Its better if you explain each event call with a sample application developed with Angular 4.

Thanks in Advance,

Martin

Labels (1)
Tags (2)
0 Karma

Gaurav_Soni
Contributor

Hi Martin,

Ideally, I would recommend placing the code(Javascript) in the hook which gets called before and after the request is handled and responded. 

In the method that gets call before the request is made add following code

var vPageView = new ADRUM.events.VPageView({
    url: 'http://localhost/#virtualpage1',
});
vPageView.start();

and then when the response is complete,

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

other methods like below and other(non-mandatory) 

// SPA view routing and HTML partials fetching
vPageView.markViewChangeStart()
vPageView.markViewChangeEnd();
  
// HTML partials inserted into Browser DOM tree
vPageView.markViewDOMLoaded();
  
// SPA HTML AJAX data fetching
// Data AJAX requests are automatically correlated with the VPageView
vPageView.markXhrRequestsCompleted();

They can be called in between wherever you can identify their best spot.

Regards,

Gaurav Soni

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Beyond Detection: How Splunk and Cisco Integrated Security Platforms Transform ...

Financial services organizations face an impossible equation: maintain 99.9% uptime for mission-critical ...

Customer success is front and center at .conf25

Hi Splunkers, If you are not able to be at .conf25 in person, you can still learn about all the latest news ...

.conf25 Global Broadcast: Don’t Miss a Moment

Hello Splunkers, .conf25 is only a click away.  Not able to make it to .conf25 in person? No worries, you can ...