How to get ISP and Region data in Real User Monitor?

How to get ISP and Region data in Real User Monitor?

The default setting of the Real User Monitor does not display ISP and region data for the end user. To obtain the data, you have the option to use a third-party Geolocation API. Currently, RUM exclusively supports APIs that provide responses in JSON format.

Understanding IP Geolocation API

An IP Geolocation API functions as a web service designed to furnish geolocation details derived from an IP address. Its purpose is to assist in ascertaining the approximate physical whereabouts of an IP address, offering applicability across a spectrum of applications and services. Generally, the IP Geolocation API requires an IP address as input and, in return, provides data concerning the corresponding geographical situation. This data encompasses particulars like the nation, region, city, and Internet Service Provider (ISP) linked to the given IP address.

Numerous IP Geolocation APIs are accessible in the market, a portion of which furnish complimentary tiers featuring usage constraints. Depending on the specific application and user volume, it becomes pivotal to assess whether the offered free tier meets requirements or if an upgraded, paid scheme becomes necessary. 

Upon acquiring a Geolocation API, it is advisable to consult the API documentation issued by the provider. Within the documentation, seek out the particulars illustrated in the following example. Subsequently, integrate these specifics into the configuration of the RUM Agent.

Example : 

  Geolocation API  https://me-apm-ip.com/json

  IP address

 
  An API might expect IP Address to be passed either in URI or query param.
  1. URI : https://me-apm-ip.com/121.0.0.1/json
  1. Query param : https://me-apm-ip.com/json?ip=121.0.0.1 
  API Response
  {
   "query": "121.0.0.1",
   "status": "success",
   "country": "India",
   "countryCode": "IN",
   "region": "TamilNadu",
   "regionCode": "TN",
   "timezone": "Asia/Kolkata",
   "isp": "VSNL"
  }

  API Response Breakdown
  'country'           :   The country associated with the IP address.
  'countryCode'  :   The two-letter country code of the country.
  'region'             :   The State/Region associated with the IP address..
  'regionCode'    :   The region code of the State associated with the IP address.
  'isp'                   :   The Internet Service Provider associated with the IP address.


Geolocation API configuration in the RUM Agent

  1. Open the GeolocationAPIResources.xml file located under <RUMAgent_Home>/conf/ directory in any text editor.
  2. Add the third-party API details to the 'GeolocationAPIResources.xml' file, mirroring the sample API configurations given below.
IP in query param
<GEO-API-DETAILS resource="1" method="queryparam" url="https://me-apm-ip.com/json"  ipKey="ip" responseType="JSON" countryKey="country" countryCodeKey="countryCode" regionKey="regionName" regionCodeKey="regionCode" ispKey="org"/>

IP in URI
<GEO-API-DETAILS resource="2" method="uri" url="http://ip-g3-location.com/{query}/json"  ipKey="ip" responseType="JSON" countryKey="location" countryCodeKey="regionCode" regionKey="regionName" regionCodeKey="regionCode" ispKey="isp"/>

1. Support for passing IP Address in URI is exclusively available starting from RUM Agent version 3.7.
2. Support for fetching region/state data is exclusively available starting from RUM Agent version 3.12 and AppManager version 172600.
 
1
  resource
  Specify the unique resource identifier.
2
  method
  Specify how the IP Address needs to be passed to the endpoint.
  1. 'queryparam' - IP address will be passed as a query string. eg: https://me-apm-ip.com/json?ip=121.0.0.1
  1. 'uri' - IP address will be passed as a URI. eg: https://me-apm-ip.com/121.0.0.1/json
3
  url

  Specify the Geolocation API.
  1. If the method is queryparam, provide the API alone. eg: https://me-apm-ip.com/json.
  1. If the method is uri,  add a {query} tag to the Geolocation API in which the IP address needs to passed. Examples :
    1. https://me-apm-ip.com/{query}/json
    2. https://test-apm-ip.com/json/{query}
4
  ipKey
  Specify the query param name in which the IP address needs to be passed. (For queryparam method).
5
  countryKey
  Specify the key in which the API response contains the country associated with the IP address.
6
  countryCodeKey
  Specify the key in which the API response contains the two-letter country code of the country.
7
  regionKey
  Specify the key in which the API response contains the region/state name associated with the IP address.
8
  regionCodeKey
  Specify the key in which the API response contains the region/state code of the region.
7
  ispKey
  Specify the key in which the API response contains the Internet Service Provider associated with the IP address.

  1. Now open the AppServer.properties file located under the <RUMAgent_Home>/conf/ directory in any text editor.
  2. Update the geo.api.type key value with the unique resource identifier as given in GeolocationAPIResources.xml file.
  3. Save the files and restart the agent.
Sample Configurations

GeolocationAPIResources.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<GEO-RESOURCES>
<GEO-API-DETAILS resource="1" method="queryparam" url="http://me-apm-ip.com/json"  ipKey="ip" responseType="JSON" countryKey="country" countryCodeKey="countryCode" regionKey="regionName" regionCodeKey="regionCode" ispKey="org"/>
<GEO-API-DETAILS resource="2" method="uri" url="http://ip-g3-location.com/{query}/json" ipKey="ip" responseType="JSON" countryKey="location" countryCodeKey="countryCode" ispKey="isp"/>
</GEO-RESOURCES>
AppServer.properties file:
#$Id$
geo.api.type=2
apm.host=localhost
apm.https.port=8441
apm.apikey=RUM4tFgjBtlKMnuWYBpQH6MC6lkoFCZKKW7

                  New to ADSelfService Plus?

                    • Related Articles

                    • Real User Monitor (RUM) - Troubleshooting

                      If the monitor has not polled data for a long time, follow the steps below for troubleshooting: Step 1: Check the RUM Agent configuration Real User Monitor requires the RUM Agent to be installed and mapped to the Applications Manager. Refer the help ...
                    • Self monitor Applications Manager using Real User Monitoring

                      We can monitor the Applications Manager using Real User Monitoring with a Java Script injection and this can be used to measure the Applications Manager's performance continuously. All you need is to install and setup the Real User Monitoring (RUM) ...
                    • Real User Monitoring Agent - Frequently asked questions

                      How to change Applications Manager details in RUM Agent? Open the AppServer.properties file located under <RUMAgent_Home>/conf/ directory in any text editor. Update Applications Manager hostname in apm.host key. Update Applications Manager SSL Port ...
                    • How to enable HTTPS connection between end user and RUM Agent?

                      By default end user data will be collected and sent via HTTP connection to RUM Agent. To enable HTTPS connection you should have an valid SSL Certificate (keystore file basically), not a self signed certificate. For RUM Agent version below 4.0, Open ...
                    • Troubleshoot - RUM Agent silent installation

                      RUM Agent silent installation can fail on various factors based on your environment, troubleshoot with the help of error message shown while running the script. Below are the list of the error messages thrown from the script and its troubleshooting ...