Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .agents/skills/cell-architecture/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,15 @@ Project.objects.filter(teams__organizationmember__user_id=user_id)
| **Denormalize to control silo** | High QPS, paginated lists, eventual consistency acceptable. Replicate needed fields to a `@control_silo_model` via outboxes — single local query, no RPC. See **hybrid-cloud-outboxes** skill. |
| **API gateway fan-out** | Temporary stopgap only — breaks pagination, latency = slowest cell. |

## Running Cell-Routing Locally

```bash
devservices up --mode cell-routing # brings up synapse + deps
SENTRY_CELL_ROUTING=1 sentry devserver # or devservices serve
```

Only cell-scoped API XHRs (`/api/0/organizations/{slug}/*`) cross to Synapse on `:13000`; UI HTML and control API stay on the sentry devserver at `:8000`. The env var gates a block in `src/sentry/conf/server.py` that sets `system.region-api-url-template` to the Synapse port and flips `system:multi-region`. The frontend reads `regionUrl` from the bootstrap blob and routes cell XHRs there per `static/app/api.tsx:715`.

## Active Migration

> Remove this section once the migration is complete.
Expand Down
9 changes: 9 additions & 0 deletions src/sentry/conf/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -3326,3 +3326,12 @@ def custom_parameter_sort(parameter: dict) -> tuple[str, int]:

if SILO_DEVSERVER or IS_DEV:
SYNAPSE_HMAC_SECRET = ["synapse-dev-secret"]

if IS_DEV and os.environ.get("SENTRY_CELL_ROUTING"):
# Pair with `devservices --mode cell-routing`. Cell-scoped API XHRs cross
# to Synapse on :13000; UI HTML and control API stay on the devserver.
SENTRY_OPTIONS["system.region-api-url-template"] = "http://dev.getsentry.net:13000"
SENTRY_OPTIONS["system.organization-base-hostname"] = "{slug}.dev.getsentry.net:8000"
SENTRY_OPTIONS["system.organization-url-template"] = "http://{hostname}"
SENTRY_FEATURES["system:multi-region"] = True
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this flag on sentry is going to want to be run in siloed mode and I think behind ngrok.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i wasn't using ngrok in my testing, it doesn't seem to be required

SENTRY_LOCAL_CELL = SENTRY_LOCAL_CELL or "--monolith--"
Loading