External Storage
OpenReplay session recordings are by default stored on your instance, but the destination can be changed to any S3-compatible object storage service, which allows for greater scalability and lower deployment costs.
Change recordings’ storage destination
Section titled Change recordings’ storage destinationRecordings 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
Section titled Create the necessary bucketsYou 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 persistedopenreplay-assets
: where assets (such as css and fonts) will be copiedopenreplay-sourcemaps
: for storing source maps (see how to upload them)openreplay-spots
: for storing spot recordings
Once the bucket created:
- 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": []
}
]
- 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, first navigate to ‘Permissions > Block public access (bucket settings)’ and turn it off, then go to ‘Permissions > Bucket policy’ and use the following configuration:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AddPerm",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::openreplay-assets/*"
}
]
}
- Finally, make sure to generate the appropriate access keys to these 4 buckets only so OpenReplay backend can programmatically access them to upload files. The required S3 permissions are:
"s3:PutObject",
"s3:GetObjectAcl",
"s3:GetObject",
"s3:GetObjectTagging",
"s3:ListBucket",
"s3:PutObjectTagging",
"s3:GetBucketLocation"
Update backend services
Section titled Update backend services- Login to your OpenReplay instance and
openreplay -e
to update the below env variables ins3
section:
Variable | Description |
---|---|
accessKey | Your object storage access key (your IAM access key ID if you’re on AWS, on Google Cloud it’d be your HMAC key for service account) |
secretKey | Your object storage secret |
endpoint | The 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 ) |
region | The region (if applicable) of your buckets (i.e. if you’re using AWS S3, this would be something like us-east-1 ) |
assetsBucket | The assets’ bucket name (i.e. openreplay-assets ) |
recordingsBucket | The recordings’ bucket name (i.e. openreplay-recordings ) |
sourcemapsBucket | The sourcemaps’ bucket name (i.e. openreplay-sourcemaps ) |
spotsBucket | The spot’ bucket name (i.e. openreplay-spots ) |
- Save and quit using
:wq
for the changes to take effect
Newly recorded sessions should now be stored and retrieved (when replayed) from your new destination/object storage service.
Have questions?
Section titled Have questions?If you encounter any issues, please connect to our Slack or check out our Forum and get help from our community.