External Storage

OpenReplay session recordings are by default stored on your instance, but the destination can be changed to any S3 object storage service, which allows for greater scalability and lower deployment costs.

Change recordings' storage destination

Recordings can be persisted in any object storage destination as long as it's S3 compatible, which makes OpenReplay compatible with all major public cloud services. Below are the steps to configure a different destination for your recordings:

Create the necessary buckets

You must create the below buckets in your object storage service. Their names can be different, but we'll use the below references in the remainder of this section:

  • openreplay-recordings: where recordings will be persisted
  • openreplay-assets: where assets (such as css and fonts) will be copied
  • openreplay-sourcemaps: for storing source maps (see how to upload them)

Once the bucket created:

  1. Enable CORS for each of the above buckets. If you're on AWS, that would be under 'Permissions > Cross-origin resource sharing (CORS)' using the following configuration:
[
{
"AllowedHeaders": [
"*"
],
"AllowedMethods": [
"GET"
],
"AllowedOrigins": [
"*"
],
"ExposeHeaders": []
}
]
  1. Enable public access to the openreplay-assets bucket only. This latter contains only stylesheets, icons and fonts that are required for proper session replay. If you're on AWS, that would be under 'Permissions > Bucket policy' using the following configuration:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AddPerm",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::openreplay-assets/*"
}
]
}
  1. Finally, make sure to generate the appropriate access keys so OpenReplay backend can programmatically access these buckets.

Update backend services

  1. Login to your OpenReplay instance and go to openreplay/scripts/helmcharts/vars.yaml then update the below env variables in s3 section:
VariableDescription
accessKeyYour object storage key
secretKeyYour object storage secret
endpointThe URL (starting with https) of your object storage service (i.e. check the list of S3 endpoints if you're on AWS, on Google Cloud Storage this would be https://storage.googleapis.com)
regionThe region (if applicable) of your buckets (i.e. if you're using AWS S3, this would be something like us-east-1)
assetsBucketThe assets' bucket name (i.e. openreplay-assets)
recordingsBucketThe recordings' bucket name (i.e. openreplay-recordings)
sourcemapsBucketThe sourcemaps' bucket name (i.e. openreplay-sourcemaps)
  1. Reinstall the above backend services for the changes to take effect:
cd openreplay/scripts/helmcharts && ./openreplay-cli -I

Newly recorded sessions should now be stored and retrieved (when replayed) from your new destination/object storage service.

Troubleshooting

If you encounter any issues, please connect to our Slack and get help from our community.