Skip to content

Commit

Permalink
Allow defining different symbolicator for JS LPQ (#49072)
Browse files Browse the repository at this point in the history
  • Loading branch information
Swatinem committed May 15, 2023
1 parent d8bdb05 commit 97cd3ad
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
10 changes: 6 additions & 4 deletions src/sentry/conf/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -2985,9 +2985,10 @@ def build_cdc_postgres_init_db_volume(settings):

# The `url` of the different Symbolicator pools.
# We want to route different workloads to a different set of Symbolicator pools.
# This can be as fine-grained as using a different pool for `js` symbolication,
# for the `lpq` (See `SENTRY_LPQ_OPTIONS` and related settings) and for normal
# symbolication. The keys here should match the `SymbolicatorPools` enum
# This can be as fine-grained as using a different pool for normal "native"
# symbolication, `js` symbolication, and for `lpq` / `lpq-js`.
# (See `SENTRY_LPQ_OPTIONS` and related settings)
# The keys here should match the `SymbolicatorPools` enum
# defined in `src/sentry/lang/native/symbolicator.py`.
# If a specific setting does not exist, this will fall back to the `default` pool.
# If that is not configured, it will fall back to the `url` configured in
Expand All @@ -2996,8 +2997,9 @@ def build_cdc_postgres_init_db_volume(settings):
# `symbolicator.options` for backwards compatibility.
SYMBOLICATOR_POOL_URLS = {
# "js": "...",
# "lpq": "...",
# "default": "...",
# "lpq": "...",
# "lpq_js": "...",
}

SENTRY_REQUEST_METRIC_ALLOWED_PATHS = (
Expand Down
8 changes: 6 additions & 2 deletions src/sentry/lang/native/symbolicator.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,21 @@ def with_low_priority(self, is_low_priority: bool) -> "SymbolicatorTaskKind":


class SymbolicatorPools(Enum):
default = "default"
js = "js"
lpq = "lpq"
default = "default"
lpq_js = "lpq_js"


class Symbolicator:
def __init__(self, task_kind: SymbolicatorTaskKind, project: Project, event_id: str):
URLS = settings.SYMBOLICATOR_POOL_URLS
pool = SymbolicatorPools.default.value
if task_kind.is_low_priority:
pool = SymbolicatorPools.lpq.value
if task_kind.is_js:
pool = SymbolicatorPools.lpq_js.value
else:
pool = SymbolicatorPools.lpq.value
elif task_kind.is_js:
pool = SymbolicatorPools.js.value

Expand Down

0 comments on commit 97cd3ad

Please sign in to comment.