ISP Data in Real User Monitoring


By default, Real User Monitor does not show ISP data of end user. To get ISP data, you can make use of any third-party Geolocation API. Currently, RUM supports only APIs that return the response in JSON format.

What is Geographical API?

An IP Geolocation API operates as an online service created to provide geographic information based on an IP address. Its goal is to aid in determining the rough physical location associated with an IP address, which can be useful for a wide range of applications and services. Typically, the IP Geolocation API takes an IP address as an input and gives back information about the related geographical position. This information includes details such as the country, region, city, and Internet Service Provider (ISP) associated with the provided IP address.

Note: There are many available IP Geolocation APIs in the market, and some of them offer free usage levels with certain limitations. Depending on the particular application and the number of users, it's crucial to determine whether the provided free tier meets your needs or if it's necessary to opt for a higher-level, paid plan.

After you have purchased any Geolocation API, seek out the particulars illustrated in the following example. Subsequently, integrate these specifics into the configuration of the RUM Agent:

AttributeDescription
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.
  • URI: https://me-apm-ip.com/121.0.0.1/json
  • 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",
"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.
'isp': The Internet Service Provider associated with the IP address.

Follow the steps given below to configure the Geological API details 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" 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" ispKey="isp"/>

    Note: Support for passing IP Address in URI is exclusively available starting from RUM Agent version 3.7.

    AttributeDescription
    resource Specify the unique resource identifier.
    method Specify how the IP Address needs to be passed to the endpoint.
    • 'queryparam' - IP address will be passed as a query string. eg: https://me-apm-ip.com/json?ip=121.0.0.1
    • 'uri' - IP address will be passed as a URI. eg: https://me-apm-ip.com/121.0.0.1/json
    url Specify the Geolocation API.
    • If the method is queryparam, provide the API alone. eg: https://me-apm-ip.com/json.
    • If the method is uri, add a {query} tag to the Geolocation API in which the IP address needs to passed. Examples:
      • https://me-apm-ip.com/{query}/json
      • https://test-apm-ip.com/json/{query}
    ipKey Specify the query param name in which the IP address needs to be passed. (For queryparam method).
    countryKey Specify the key in which the API response contains the country associated with the IP address.
    countryCodeKey Specify the key in which the API response contains the two-letter country code of the country.
    ispKey Specify the key in which the API response contains the Internet Service Provider associated with the IP address.
  3. Now open the AppServer.properties file located under <RUMAgent_Home>/conf/ directory in any text editor and update the value for the key geo.api.type with that of the resource value given in GeolocationAPIResources.xml file.
  4. 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" url="http://me-apm-ip.com/json" ipKey="ip" responseType="JSON" countryKey="country" countryCodeKey="countryCode" ispKey="org"/>
<GEO-API-DETAILS resource="2" url="http://ip-g3-location.com/json" ipKey="ip" responseType="JSON" countryKey="location" countryCodeKey="regionCode" ispKey="isp"/>
<GEO-API-DETAILS resource="3" url="http://zoho.iplocation.com/json" ipKey="ipAddress" responseType="JSON" countryKey="cn" countryCodeKey="cncode" ispKey="org"/>
</GEO-RESOURCES\>

AppServer.properties file:

#$Id$
geo.api.type=2
apm.host=localhost
apm.https.port=8441
apm.apikey=RUM4tFgjBtlKMnuWYBpQH6MC6lkoFCZKKW7