How to integrate SumoLogic with Asayer and see backend errors alongside session replays.

1. Create a new Access ID and Access Key

  1. Login to your SumoLogic account.
  2. Go to the Access Keys page.
  3. Click on + Add Access Key.
  4. In the name put "asayer" and click on Create Key.
  5. Copy the new Access ID and Access Key as we need them for our integration.
  6. Click on Done.

For more information about creating an Access ID and Access Key, please refer to this documentation.

2. Enable SumoLogic in Asayer

Put your Access ID and Access Key in Asayer dashboard under Preferences > Integrations.

SumoLogic Integration in Asayer

3. Propagate asayerSessionId

To link a SumoLogic event with the recorded user session, a unique id has to be propagated from your frontend to your backend on each request you want to track. This can be done using a custom HTTP header. In the below example, we use the fetch function to send that header.

const headers = {
Accept: 'application/json',
'Content-Type': 'application/json',
if (window.asayer && {
headers['X-Session-Id'] =; // Inject asayer_session_id
fetch('', {

In order for Asayer to associate a SumoLogic message with the recorded user session, a unique id has to be propagated as part of each backend error you wish to track.

Below is an example in Python using Monkey Patching.

import sys
import traceback
old_tb = traceback.print_exception
old_f = sys.stdout
old_e = sys.stderr
class F:
def write(self, x):
if ASAYER_SESSION_ID is not None and x != '\n':
old_f.write(f"[asayer_session_id={ASAYER_SESSION_ID}] {x}")
def flush(self):
def tb_print_exception(etype, value, tb, limit=None, file=None, chain=True):
if ASAYER_SESSION_ID is not None:
value = type(value)(f"[asayer_session_id={ASAYER_SESSION_ID}] " + str(value))
old_tb(etype, value, tb, limit, file, chain)
traceback.print_exception = tb_print_exception
sys.stderr = F()

The name of the tag asayer_session_id is case sensitive.