Splunk AppDynamics

How to send additional info on AJAX response?

CommunityUser
Splunk Employee
Splunk Employee

Hi

I'm able to add custom data (.i to `username`) to AJAX request, but is it possible to add more info to the tracker, such as `number of records returned by the server`?

(window['adrum-config'] || (window['adrum-config'] = {
  'userEventInfo': {
    'Ajax': function (context) {
      return {
        userData: {
          'username': 'MY_USERNAME'
        },
      }
    },
  },

I tried creating it programmatically, but how do we add additional data to this?

var ajaxT = new ADRUM.events.Ajax();
   
// set url
ajaxT.url('your xhr Url');
   
// mark timings
ajaxT.markSendTime(100);
ajaxT.markFirstByteTime(200);
ajaxT.markRespAvailTime(300);
ajaxT.markRespProcTime(400);
ADRUM.report(ajaxT);

Many thanks,

Ozay

Labels (1)
0 Karma

Chitra_Lal
Contributor

Hi Ozay,

Are you trying to capture the Ajax response values as user data? If yes, Are those POST calls? Because if that is the case you can use the xhr object to configure the JavaScript Agent to capture POST parameters.

https://docs.appdynamics.com/display/PRO44/Set+Ajax+Request+Names+Based+on+Captured+POST+Parameters#...

Once the required POST parameters are captured correctly, you can actually send them as custom data using the information in the below link:

https://docs.appdynamics.com/display/PRO44/Add+Custom+User+Data+to+a+Page+Browser+Snapshot

Let me know in case your requirement differs. 

Thanks,

Chitra

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!

Tech Talk Recap | Mastering Threat Hunting

Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...