S3 compatible object storage instead of just Amazon S3

I see there is Amazon S3 available for debug file storage, but I’d prefer to use any S3-compatible object storage, whether some other object storage service or my own MinIO.

Is there a way to specify a different endpoint in the filestore.options section of sentry/config.yml? For that matter, are more options already supported? Or would this be a candidate for a pull request? :slight_smile:

You can pass anything under filestore.options based on this code:

The S3 backend should support those options though: sentry/s3.py at 4547e96890a389008ce998d4e5b2b37790434247 · getsentry/sentry · GitHub

If not you can either submit a PR to extend that backend or add your own backend that does whatever you want and use that :slight_smile:

1 Like

I can confirm this works. Uploaded debug information files are stored in the S3 bucket. I’d recommend using a dedicated bucket. Downloads from sentry onpremise go through the sentry server, as a note, rather than directly from the S3 bucket. Performance is fine. After updating the config.yml I had to restart at least the web and workers service (If you can, just restart everything).

docker-compose restart web worker
or
docker-compose restart

I hadn’t put the “https://” as part of the endpoint_url config, and there were errors of “invalid endpoint” in the logs for the web services (just to mention where I was looking while troubleshooting):

docker-compose logs web

My sentry/config.yml storage section looks like this:

################
# File storage #
################

# Uploaded media uses these `filestore` settings. The available
# backends are either `filesystem` or `s3`.

#filestore.backend: 'filesystem'
#filestore.options:
#  location: '/data/files'
dsym.cache-path: '/data/dsym-cache'
releasefile.cache-path: '/data/releasefile-cache'

filestore.backend: 's3'
filestore.options:
  endpoint_url: 'https://my.s3-compatible-endpoint.com'
  region_name: 'the_region_name'
  access_key: 'my_access_key_string'
  secret_key: 'my_secret_key_string'
  bucket_name: 'my-bucket-name'
1 Like