Skip to content

Commit 1ddb182

Browse files
le0pardBYK
andauthored
Support external sourcemaps bigger, than 1Mb (#2050)
* Support external sourcemaps bigger, than 1Mb (25Mb limit) * Update docker-compose.yml Co-authored-by: Burak Yigit Kaya <[email protected]> * improve settings for soursemaps * Update sentry/sentry.conf.example.py Co-authored-by: Burak Yigit Kaya <[email protected]> * improve settings for soursemaps * fix ident --------- Co-authored-by: Burak Yigit Kaya <[email protected]>
1 parent ae4522a commit 1ddb182

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

docker-compose.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ x-sentry-defaults: &sentry_defaults
7070
# on the host system (or in the .env file)
7171
SENTRY_EVENT_RETENTION_DAYS:
7272
SENTRY_MAIL_HOST:
73+
SENTRY_MAX_EXTERNAL_SOURCEMAP_SIZE:
7374
volumes:
7475
- "sentry-data:/data"
7576
- "./sentry:/etc/sentry"
@@ -106,6 +107,7 @@ services:
106107
memcached:
107108
<<: *restart_policy
108109
image: "memcached:1.6.9-alpine"
110+
command: ["-I", "${SENTRY_MAX_EXTERNAL_SOURCEMAP_SIZE:-1M}"]
109111
healthcheck:
110112
<<: *healthcheck_defaults
111113
# From: https://stackoverflow.com/a/31877626/5155484

sentry/sentry.conf.example.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@
33

44
from sentry.conf.server import * # NOQA
55

6+
BYTE_MULTIPLIER = 1024
7+
UNITS = ("K", "M", "G")
8+
def unit_text_to_bytes(text):
9+
unit = text[-1].upper()
10+
power = UNITS.index(unit) + 1
11+
return float(text[:-1])*(BYTE_MULTIPLIER**power)
12+
613

714
# Generously adapted from pynetlinux: https://github.com/rlisagor/pynetlinux/blob/e3f16978855c6649685f0c43d4c3fcf768427ae5/pynetlinux/ifconfig.py#L197-L223
815
def get_internal_network():
@@ -107,6 +114,9 @@ def get_internal_network():
107114
"BACKEND": "django.core.cache.backends.memcached.MemcachedCache",
108115
"LOCATION": ["memcached:11211"],
109116
"TIMEOUT": 3600,
117+
"OPTIONS": {
118+
"server_max_value_length": unit_text_to_bytes(env("SENTRY_MAX_EXTERNAL_SOURCEMAP_SIZE", "1M")),
119+
},
110120
}
111121
}
112122

0 commit comments

Comments
 (0)