Repository navigation
Android Testing locally and Debugging 0.4.0
This page refers to instructions on testing the Android Tracker locally and debugging any issues that might crop up. These instuctions are aimed at version 0.4.0 of the Android Tracker.
To test the Android Tracker locally we use a combination of two softwares: Mountebank and Ngrok.
Mountebank provides a local webserver which we can apply imposters to run on different ports. An imposter in this context is just a mock which, for our purposes, does some light validation to ensure that the event it receives is indeed a valid Snowplow Event. This is the imposter that we use for validating our events.
We then get Ngrok to listen on the same port as the imposter port. This provides two things:
- A clean easy to use Web Interface with details about each event.
- Found at
http://localhost:4040/
- Found at
- An endpoint that you can send to from anywhere.
When you visit the Ngrok Web Interface you will see the tunnel URL that you can use to send events to.
To actually set this up you will need to follow these steps:
host$ git clone https://github.com/snowplow/snowplow-android-tracker.git
host$ cd snowplow-android-tracker
host$ vagrant up && vagrant ssh
guest$ cd /vagrant
guest$ chmod +x ./testing/setup.bash
guest$ ./testing/setup.bashThe setup.bash script starts Mountebank and starts the imposter we want and then starts Ngrok listening on the imposter port.
Once you have it running you can supply the tunnel URL for all logging of events until you are ready to switch to a collector!
This section will detail how to handle common problems with running the local testing setup.
If you are already using ports 2525 or 4040 your vagrant up will fail. Easiest way to resolve this is to stop any services running on these ports and then attempt to vagrant up again.
However if this is not an option you will need to edit the Vagrantfile in the root of the project:
config.vm.network "forwarded_port", guest: 4040, host: 4040 ## Change the host to something free
config.vm.network "forwarded_port", guest: 2525, host: 2525 ## Change the host to something free
If you have successfully started Ngrok and you have an endpoint but your events are not getting there chances are that Mountebank as failed to start properly.
To resolve:
guest$ curl -X DELETE http://localhost:2525/imposters/4545
guest$ curl -i -X POST -H 'Content-Type: application/json' -d@/vagrant/snowplow-android-tracker-rx/src/androidTest/assets/imposters.json http://localhost:2525/impostersThis will delete the imposter and create a new one in its place.
If you you cannot get to the Ngrok Web Interface at all the best way to resolve is the following:
host$ cd snowplow-android-tracker
host$ vagrant halt
host$ vagrant up && vagrant ssh
guest$ cd /vagrant
guest$ ./testing/setup.bashThis simply stops the VM and restarts it.
Home | About | Project | Setup Guide | Technical Docs | Copyright © 2012-2017 Snowplow Analytics Ltd
HOME » TECHNICAL DOCUMENTATION
1A. Trackers
Overview
ActionScript3 Tracker
Android Tracker
Arduino Tracker
CPP Tracker
Golang Tracker
Google AMP Tracker
iOS Tracker
Java Tracker
JavaScript Tracker
Lua Tracker
.NET Tracker
Node.js Tracker
PHP Tracker
Pixel Tracker
Python Tracker
Ruby Tracker
Scala Tracker
Unity Tracker
Building a Tracker
1B. Webhooks
Iglu webhook adapter
CallRail webhook adapter
MailChimp webhook adapter
Mandrill webhook adapter
PagerDuty webhook adapter
Pingdom webhook adapter
SendGrid webhook adapter
Urban Airship Connect webhook adapter
2. Collectors
Overview
Cloudfront collector
Clojure collector (Elastic Beanstalk)
Scala Stream Collector
3. Enrich
Overview
EmrEtlRunner
Stream Enrich
Scala Hadoop Shred
Hadoop Event Recovery
C. Canonical Snowplow event model
4. Storage
Overview
Storage in S3
Storage in Redshift
Storage in PostgreSQL
Storage in Infobright (deprecated)
The StorageLoader
D. Snowplow storage formats (to write)
5. Analytics
Analytics-documentation
Event-manifest-populator
Common
Shredding
Artifact repositories