Splunk AppDynamics

How to export the status code and ajax error code from browser snapshot data for analytics purpose?

Dhiraj_Choudhar
Explorer

I am trying to export the status code and ajax error code in user experience from browser snapshot data of respective requests for our analytics purpose? Is there any way to do this?

I tried with multiple options but am not sure how will be able to export these.

I have used analytics API as an alternative to fetch these values but I see ajax error value is always captured null for all the requests on the analytics level.

image.jpeg

You can see above our requirement is to just capture this status code and ajax error code for the respective API.

Please help me with this.

Labels (1)
0 Karma

Rodson_Tadeu
New Member

Hi!

How did you get the http status code on BRUM?

Regards,

0 Karma

Hiroki_Ito
Contributor

Thank you for posting to the community.
Unfortunately, browser snapshot data cannot be exported.

However, data collected by browser RUM can be exported from the web analyze page.

From there, you can export AJAX Error data although http status code doesn't exist in analyze section.
You mentioned Ajax Error code, but it doesn't exist in Browser Snapshots. I believe you meant Ajax Error, but am I correct?

In addition, AJAX Error value should also be visible from analytics, but you mentioned analytics API returned null for all the requests. Could you please check the analytics data again from analytics page by searching "Browser Requests" and enabling AJAX Error field?
image.png
Best Regards,
Hiroki

Dhiraj_Choudhar
Explorer

Hi Team,

I have followed the steps that you have provided, however, I can see the Null value is only captured for Ajax error that is not correct.

Could you please guide me further in order to get the correct value of the Ajax error?

image.png

I have noticed one more thing all this analytics level data is sync with REAL USER -Analyze tab. As you can see we are capturing nothing here ajax error in the real user tab so my question remains the same is there any way so that Ajax error we would be able to capture.

image.png

In case if some configuration mistake we are doing from our end on the end-user experience level please guide me for those as well so that we will correct those and will start capturing those data(Ajax error).

As I see in the screenshot shared by you that you are able to capture that Ajax error. It would be really helpful if you can share your configuration for monitoring the end-user so that we will be also doing the same.

Thanks and Regards,

Dhiraj Kumar

^ Edited by @Ryan.Paredez to remove PII. Please do not leave your phone number on community posts. I would recommend sharing that as a private message with someone if you two decide to communicate that way. 

0 Karma

Hiroki_Ito
Contributor

Hi @Dhiraj.Choudhary ,

Thank you for checking the analytics data.

Could you please check below?

image.png

  • Please confirm if there are any rules for "Events Service Include Rules" for AJAX Events Service setting. If there are no rules, please add rules in order to publish the AJAX request to Event Service(Analytics).
    You can access AJAX Events Service setting from browser application->Configuration->Instrumentation->Ajax tab->Events Service tab.
    By default, there may be no rule, and if no rules are specified, no data on Ajax requests is sent to analytics.
    https://docs.appdynamics.com/21.3/en/end-user-monitoring/browser-monitoring/browser-real-user-monito... 

After adding include rules, please check Analyze page by filtering Page Type by AJAX and see if there is any record for AJAX requests.

image.png

Best Regards,

Hiroki

Dhiraj_Choudhar
Explorer

Hi Team,

Thank you!! for you valuable comments We are able to get Ajax error in Analytics as I have tweaked some configuration based on your input and official documentation.

I was stuck on below points as we are in the process of enhancing health rule based on capability that AppDynamics can provide  :

1.Just  wanted to check if there is any way we can configure the health rule on AppDynamics level where we can send the alert only when we get 500 series Ajax error. As those are the critical one and we need immediate attention.

2.If we need to configure health rule for JavaScript error on browser level (for example if we want to send the alert if java script error occurs on IE browser)is there any way for that.

It would be really help full for us .if you can provide some insight on above query.

Thanks and Regards,

Dhiraj Kumar

0 Karma

Hiroki_Ito
Contributor

Hi @Dhiraj.Choudhary ,

Great to hear you could get Ajax error in Analytics.

1. You can create an Analytics metric from ADQL and monitor it with a health rule.
e.g.
ADQL like below will make a metric for the number of 500 Ajax error for XXX url. By making a health rule that becomes critical once the metric value exceeds 1, you may be able to monitor the number of 500 Ajax error.

SELECT count(*) FROM browser_records WHERE pagename LIKE "XXX" ajaxerror LIKE "*status*500*"

https://docs.appdynamics.com/21.8/en/analytics/using-analytics-data/create-analytics-metrics-from-sc...

2. JavaScript error may be available in analytics too, so you can create a custom metric and monitor it.
You can search JavaSciprt error with ADQL like below.

SELECT count(*) FROM browser_records WHERE scripterrordata.message IS NOT NULL.

https://docs.appdynamics.com/21.8/en/analytics/using-analytics-data/visualize-javascript-errors

Best Regards,
Hiroki

Dhiraj_Choudhar
Explorer

Thank you for the response really helped a lot!!

Just one question could you help me with the way configure health rules with specific http error code ,Ajax error from EUM.

It would be really help full if you will provide steps by steps way to do the same with screenshot.

Hiroki_Ito
Contributor

Hi @Dhiraj.Choudhary ,


Sure!

1. From [Analytics]->[Searches]->[Query Language Search] Page, create Analytics Metric using ADQL.
 image.png


2. Wait for several minutes and confirm the Analytics metric is working as intended from the metric browser.
 image.png

3. From [Alert & Response]->[Health Rules] page, create a health rule for the Analytics metric. Select Analytics for the target.
 image.png

3-1. You can configure Health Rule schedules and wait time after violation in the overview panel.
Please see the document below for details of the configurations.
  image.png

3-2. Affected Entities may be default.
image.png

3-3. For the Critical or Warning Criteria, create health rule conditions for the Analytics metric. The rule may depend on how you would like to monitor the application, so please see the documents below for the details of configuration.
 image.png

4. After a health rules is created, you can create a policy from [Alert & Response]->[Policies] page. Select Analytics for the target.
Please see the document below for creating a policy.
 image.png

Best Regards,
Hiroki

Dhiraj_Choudhar
Explorer

Hi Team,

Thank you for the update!!

Is there any way to delete the custom metric that we have created on AppDynamics from the ADQL query on the analytics level as you suggested below?

Thanks and Regards,

Dhiraj Kumar

Post edited by @Claudia.Landivar to remove a phone number. Please do not share your or other phone numbers on community posts. 

0 Karma

Hiroki_Ito
Contributor
I believe you can see the list of created metrics from Analytics->Metrics page.
You can delete the metrics on that page too.
image.png
Best Regards,
Hiroki

Dhiraj_Choudhar
Explorer

Hi Team,

Thank you for your quick response!!

One strange behavior we observed in AppDynamics Ajax error code(500 series error) count in analytics through ADQL and browser snapshot((500 series error))for the same base URL.

image.png

For Analytics above we get the count 522 for Ajax error code 500 series.

But for the same when we verified from browser snapshot as per my understanding for the same page name we should be getting the same count but we are getting only 228 counts for the same time range as you can see below.

image.png

why is there a difference in count in browser snapshot data and data we get through ADQL?

Do we have any restriction on the total no of counts that we get on browser snapshot data?

Please clarify that point. It would be really helpful in order to implement the same on the project level as we are planning to create some custom metrics using an ADQL analytics query. We observed these differences so just looking for some clarification to avoid any discrepancies later point in time.

Thanks and Regards,

Dhiraj Kumar

0 Karma

Hiroki_Ito
Contributor

As written in the document below, browser snapshots are collected every minute from collection of beacon samples. All errors may not be captured but rather a sampling of them.

Therefore, the count in browser snapshots may be less than data from ADQL Analytics query.
With Analytics, every event(request) is captured, so the number from ADQL Analytics query should be accurate.

Best Regards,
Hiroki
0 Karma

iamryan
Community Manager
Community Manager

Hello @Dhiraj.Choudhary,

Did you have any more follow-up questions for @Hiroki.Ito? Did he help answer your question? If so, be sure to click on the Accepted Solution button on one of his replies.

0 Karma

Dhiraj_Choudhar
Explorer

Hi Team,

Thank you Very much !!

Is there a way to capture the JavaScript error from analytics and create the health rule based on that and send the alerts if that occurs to user?

Please help as we are struggling for the same. 

Thanks,

Dhiraj Kumar

0 Karma

Hiroki_Ito
Contributor

Could you please check the JavaScript error data is available from analytics?
You can see the data by enabling Script Error fields.
image.png

 
 
If not, please check if "Enable JavaScript Error Capture" checkbox on Configuration->Instrumentation->Errors tab is enabled.

You can create analytics metrics from Javascript Error like the screenshot and ADQL below.
SELECT count(*) FROM browser_records WHERE scripterrordata.message IS NOT NULL
image.png

Then, steps to monitor the metric with a health rule is same for Ajax error.

Best Regards,
Hiroki
0 Karma
Get Updates on the Splunk Community!

Announcing the Expansion of the Splunk Academic Alliance Program

The Splunk Community is more than just an online forum — it’s a network of passionate users, administrators, ...

Learn Splunk Insider Insights, Do More With Gen AI, & Find 20+ New Use Cases You Can ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Buttercup Games: Further Dashboarding Techniques (Part 7)

This series of blogs assumes you have already completed the Splunk Enterprise Search Tutorial as it uses the ...