kevindavis / segment-relay

Micro-service that relays events from Segment into a database for analysis

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

segment-relay

Segment-relay is a micro-service that relays events from Segment.io into a database where you can do free-form analysis.

How to use..

  1. Deploy this code somewhere

    Deploy

    Remember the URL you deployed it to, you'll need it in step 4. If you used the deploy button above it should look something like [yourappname].herokuapp.com.

  2. Set up a Postgres DB

    A database should be created and set up for you if you use the deploy button above.

    If not, create a Postgres database, set a DATABASE_URL environment variable to a valid connection string and run rake db:create to create the events table (see schema below)

  3. Start relaying your events from Segment

    activate webhook

    configure webhook

  4. Connect an analysis tool of your choice to your database

Schema

segment-relay uses a single 'events' table to store event data. Naming derived from the Mode playbook

  • user_id, text
  • event_name, text
  • details, json or jsonb depending on the version of Postgres you're using (jsonb available in 9.4 and above and is considerably faster)
  • occurred_at, timestamp

About

Micro-service that relays events from Segment into a database for analysis

License:MIT License


Languages

Language:Ruby 89.8%Language:Python 10.2%