Export Logs to Mixpanel

Export Logs to Mixpanel

The Auth0 Logs to Mixpanel extension consists of a scheduled job that exports your Auth0 logs to Mixpanel, an interactive product and user analytic service. This document will guide you through the process of setting up this integration.

To learn more, read Product Resource Hub in Mixpanel.

Retrieve required information from Mixpanel

First, you need to get the Mixpanel Token and API Key that Auth0 will use to connect and push logs:

  1. Log in to Mixpanel.

  2. Click Account Settings.

  3. Click the Projects tab.

  4. Copy the Token and API Key information; you will need these values in the next section.

    Dashboard - Extensions - Mixpanel - Mixpanel Project Info

Configure the extension

To install and configure this extension:

  1. Navigate to Auth0 Dashboard > Extensions, and select Auth0 Logs to Mixpanel. The Install Extension window opens.

    Dashboard - Extensions - Mixpanel - Extension Mgmt Mixpanel
  2. Set the following configuration parameters, and select Install:

  • Schedule: The frequency with which logs should be exported. The schedule can be customized even further after creation.

  • MIXPANEL_TOKEN: The Mixpanel Token for the project to which you want the Auth0 logs to be exported. Enter the Token value you retrieved in the previous section.

  • MIXPANEL_KEY: The Mixpanel API Key for the project to which you want the Auth0 logs to be exported. Enter the API Key value you retrieved in the previous section.

  • BATCH_SIZE: The number of logs to be sent per batch. Maximum is 20. Logs are batched before sending, and multiple batches are sent each time the extension runs.

  • LOG_LEVEL: The minimal log level of events that you would like sent to Mixpanel.

  • LOG_TYPES: The events for which logs should be exported.

The integration between Auth0 and Mixpanel is now in place!

Batch size

When setting your BATCH_SIZE, please keep the following information in mind.

During each time frame/window (defined by your chosen Schedule), outstanding logs will be batched into groups and sent. The size of each group is determined by the BATCH_SIZE value.

In other words, during each window, NUM_BATCHES batches of logs will be sent based on the following logic:

IF (NUM_LOGS modulo 100 == 0): NUM_BATCHES = (NUM_LOGS / BATCH_SIZE) ELSE: NUM_BATCHES = (NUM_LOGS / BATCH_SIZE) + 1

In the ELSE case, the last batch will have < 100 logs.

View results

The integration you just set up created a scheduled job that is responsible for exporting the logs.

To view this scheduled job:

  1. Navigate to Auth0 Dashboard > Extensions, and select Installed Extensions.

  2. Select Auth0 Logs to Mixpanel. The job you just created appears. You can modify its state by toggling the State switch, see when the next run is due, and see the result of the last execution.

    Dashboard - Extensions - Azure - View Cron Jobs

You can view more details by clicking on the job you created. On this page, you can view details for each execution, reschedule the job, access realtime logs, and more.

Dashboard - Extensions - Azure - View Cron Details

That's it; you are done! You can now navigate to Mixpanel and view your Auth0 Logs.

Dashboard - Extensions - Mixpanel - Auth0 Logs at Mixpanel