GeoIP data for Tracker documents
Martini can also automatically add geolocation data to a
Tracker document from an HTTP request. It does this by leveraging
MaxMind's GeoIP database. You can either install the database yourself in the
data/geoip directory, or have Martini download and update them for you.
Installation using the user interface
To have Martini download the GeoIP database for you:
- Sign up for GeoLite2 downloadable databases.
- Once you have an account, create a license key.
- Provide the license key to Martini using the
In the Martini Runtime Admin UI, hover over the Configuration menu, then click Geo. IP Database.
Once the file has been downloaded, a dialog will appear telling you that it has completed:
Installation using REST endpoints
Martini also provides REST endpoints for downloading and updating the GeoIP database.
POST request to the following endpoint to download the database:
The easiest way to do this is to use the API Explorer.
Martini will also log messages similar to the ones below outlining that the database has been downloaded.
1 2 3 4
28/04/20 02:26:12.886 INFO [MaxmindGeoIpService] Starting to download cities database 28/04/20 02:26:14.449 INFO [MaxmindGeoIpService] GeoIP database downloaded to /opt/toro-martini/data/geoip/cities.mmdb 28/04/20 02:26:14.631 INFO [MaxmindGeoIpService] Starting to download countries database 28/04/20 02:26:14.870 INFO [MaxmindGeoIpService] GeoIP database downloaded to /opt/toro-martini/data/geoip/countries.mmdb
Once the database is installed, any subsequent document that was created from an HTTP request will have the
Request Coordinates, and
Request Country properties added, as shown below:
Integration with Google Maps
Martini can also show a map of the GeoIP location. To enable this, get a Google Maps API key,
and add it to the
tracker.google-maps-api-key application property.
Once this is done, the Martini Runtime Admin UI will also display
a map of the location for all existing and new documents.